/* ==================== GLOBAL RESET ==================== */
* { box-sizing: border-box; }

/* ==================== DASHBOARD LAYOUT ==================== */
.dashboard-layout {
  display: flex;
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background-color: #f1f5f9;
}

/* ==================== SIDEBAR ==================== */
.sidebar {
  width: 260px;
  background-color: #0f172a;
  color: #fff;
  display: flex;
  flex-direction: column;
  padding: 20px 0;
  flex-shrink: 0;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.nav-item {
  text-align: left;
  padding: 12px 16px;
  background: none;
  border: none;
  color: #cbd5e1;
  font-size: 14px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}
.nav-item:hover { background-color: #1e293b; color: #fff; }
.nav-item.active { background-color: #2563eb; color: #fff; font-weight: 600; }

.sidebar-section-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  background: transparent;
  border: none;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #94a3b8;
  font-weight: 700;
  margin-top: 20px;
  margin-bottom: 4px;
  padding: 6px 16px;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
}
.sidebar-section-title span { font-size: 16px; }

.sidebar-footer {
  padding: 16px 20px 0;
  border-top: 1px solid #1e293b;
}
.change-pw-btn {
  width: 100%;
  padding: 8px;
  background-color: #2563eb;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 500;
  font-family: inherit;
  font-size: 13px;
  margin-bottom: 8px;
}
.logout-btn {
  width: 100%;
  padding: 8px;
  background-color: #dc2626;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 500;
  font-family: inherit;
}

/* ==================== MAIN CONTENT ==================== */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

.main-app-header {
  background: #0f172a;
  color: #fff;
  padding: 16px 30px 14px;
  flex-shrink: 0;
}
.main-app-header h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.2px;
}
.main-app-header p {
  margin: 4px 0 0;
  font-size: 13px;
  color: #93c5fd;
  font-weight: 600;
}

/* ==================== TOP TABS ==================== */
.top-tabs-container {
  display: flex;
  background: #fff;
  border-bottom: 2px solid #e2e8f0;
  padding: 0 30px;
  flex-shrink: 0;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}
.top-tab {
  padding: 18px 24px;
  background: transparent;
  border: none;
  border-bottom: 4px solid transparent;
  font-size: 16px !important;
  font-weight: 800 !important;
  color: #64748b;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  letter-spacing: 0.3px;
}
.top-tab:hover { color: #1e293b; background: #f8fafc; }
.top-tab.active { 
  color: #2563eb; 
  border-bottom-color: #2563eb; 
  font-weight: 900 !important; 
  background: #eff6ff;
}

.page-wrapper {
  padding: 20px 30px;
  flex: 1;
  overflow-y: auto;
}

/* ==================== MODERN CLICKABLE TABS (NEW) ==================== */
.ops-tabs, .leave-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 24px;
  background: #f1f5f9;
  padding: 6px;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  flex-wrap: wrap;
  width: fit-content;
}

.ops-tab-btn, .leave-tab {
  padding: 10px 20px;
  border: none;
  background: transparent;
  color: #64748b;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  border-radius: 8px;
  font-family: inherit;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.ops-tab-btn:hover, .leave-tab:hover {
  background: #e2e8f0;
  color: #1e293b;
}

.ops-tab-btn.active, .leave-tab.active {
  background: #ffffff;
  color: #2563eb;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
}

/* ==================== STAFF PAGE ==================== */
.staff-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}
.staff-header h2 { margin: 0; color: #1e293b; }

.add-staff-btn {
  background-color: #2563eb;
  color: white;
  border: none;
  padding: 10px 18px;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
}
.staff-form {
  background: white;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  margin-bottom: 20px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.staff-form input, .staff-form select {
  padding: 10px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  width: 100%;
}
.staff-form button {
  grid-column: span 2;
  padding: 12px;
  background-color: #16a34a;
  color: white;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
}
.staff-list {
  background: white;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  overflow-x: auto;
}
.staff-list table { width: 100%; border-collapse: collapse; }
.staff-list th, .staff-list td {
  padding: 14px 18px;
  text-align: left;
  border-bottom: 1px solid #e2e8f0;
  font-size: 14px;
}
.staff-list th { background-color: #f8fafc; font-weight: 600; color: #475569; }
.delete-btn {
  background-color: #fee2e2;
  color: #dc2626;
  border: none;
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
}
.edit-btn {
  background-color: #dbeafe;
  color: #1d4ed8;
  border: none;
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
}
.empty-state { padding: 40px; text-align: center; color: #64748b; }

/* ==================== EXPORT BUTTONS ==================== */
.export-btn {
  padding: 10px 16px;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  font-size: 13px;
  font-family: inherit;
}
.jpg-btn { background-color: #0891b2; color: white; }
.pdf-btn { background-color: #dc2626; color: white; }
.print-btn { background-color: #475569; color: white; }
.copy-btn { background-color: #0891b2; color: white; }
.bulk-btn { background-color: #7c3aed; color: white; }

/* ==================== WEEK NAVIGATION ==================== */
.week-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  background: white;
  padding: 15px 20px;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  flex-wrap: wrap;
  gap: 10px;
}
.week-nav button { background-color: #2563eb; color: white; border: none; padding: 8px 16px; border-radius: 6px; cursor: pointer; font-weight: 600; font-family: inherit; }

/* ==================== BULK ASSIGN FORM ==================== */
.bulk-form {
  background: linear-gradient(135deg, #faf5ff 0%, #f3e8ff 100%);
  border: 2px solid #a855f7;
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.1);
}
.bulk-form-title {
  font-weight: 700;
  color: #6d28d9;
  font-size: 15px;
  margin-bottom: 16px;
}
.bulk-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 16px;
}
.bulk-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.bulk-field-full { grid-column: span 2; }
.bulk-field label {
  font-size: 12px;
  font-weight: 600;
  color: #6b21a8;
  letter-spacing: 0.3px;
}
.bulk-field select,
.bulk-field input {
  padding: 10px;
  border: 1px solid #c4b5fd;
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  background: #ffffff;
  color: #1e293b;
}
.bulk-field select:focus,
.bulk-field input:focus {
  outline: none;
  border-color: #7c3aed;
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.15);
}
.bulk-day-buttons {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.day-btn {
  padding: 8px 14px;
  border: 1px solid #c4b5fd;
  background: #ffffff;
  color: #6b21a8;
  border-radius: 6px;
  font-weight: 600;
  font-size: 12px;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}
.day-btn:hover { background: #ede9fe; }
.day-btn.active {
  background: #7c3aed;
  color: #ffffff;
  border-color: #7c3aed;
}
.bulk-preview {
  background: #ffffff;
  border: 1px solid #c4b5fd;
  border-radius: 6px;
  padding: 12px 16px;
  margin-bottom: 14px;
  color: #6d28d9;
  font-size: 14px;
}
.bulk-submit-btn {
  width: 100%;
  padding: 12px;
  background: #7c3aed;
  color: white;
  border: none;
  border-radius: 6px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  font-family: inherit;
}
.bulk-submit-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ==================== ROSTER GRID & COLORS ==================== */
.roster-export-area {
  background: #ffffff;
  padding: 12px 16px;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch;
}
.roster-title { text-align: center; margin-bottom: 8px; }
.roster-title h1 { font-size: 20px !important; margin: 0; color: #0f172a !important; font-weight: 900 !important; font-family: Arial, sans-serif; text-transform: uppercase; letter-spacing: 1px; }
.roster-week-section { margin-bottom: 6px; }
.week-label { font-size: 10px; font-weight: 700; color: #000000; margin: 0 0 2px 0; font-family: Arial, sans-serif; }

.print-week-header { display: none; }

.week-grid { width: 100%; border-collapse: collapse; margin: 0; font-family: Arial, sans-serif; table-layout: fixed; }
.week-grid th, .week-grid td {
  border: 1px solid #000000; 
  padding: 1px 2px; 
  font-size: 9px;
  text-align: center; 
  white-space: nowrap; 
  overflow: hidden; 
  text-overflow: ellipsis;
  color: #000000; 
  background-color: #ffffff; 
  height: 18px;
  line-height: 1.1;
}
.week-grid thead th { background-color: #22c55e !important; color: #ffffff !important; font-weight: 700; height: 20px; font-size: 8px; }

.week-grid .col-sn { width: 55px; font-weight: 600; text-align: left; }
.week-grid .col-name { width: 160px; text-align: left; font-weight: 600; font-size: 10px; }

.week-grid tbody tr:nth-child(odd) td.empty-cell { background-color: #ffffff; }
.week-grid tbody tr:nth-child(even) td.empty-cell { background-color: #fdf6e3; }
.week-grid tbody tr:nth-child(odd) td.col-sn, .week-grid tbody tr:nth-child(odd) td.col-name { background-color: #ffffff; }
.week-grid tbody tr:nth-child(even) td.col-sn, .week-grid tbody tr:nth-child(even) td.col-name { background-color: #fdf6e3; }

.week-grid tbody td.shift-morning { background-color: #d1fae5 !important; color: #065f46 !important; font-weight: bold; }
.week-grid tbody td.shift-day { background-color: #dbeafe !important; color: #1e40af !important; font-weight: bold; }
.week-grid tbody td.shift-afternoon { background-color: #ffedd5 !important; color: #9a3412 !important; font-weight: bold; }
.week-grid tbody td.shift-night { background-color: #f3e8ff !important; color: #6b21a8 !important; font-weight: bold; }
.week-grid tbody td.shift-custom { background-color: #f1f5f9 !important; color: #334155 !important; font-weight: bold; }

.week-grid tbody td.leave-off { background-color: #fecaca !important; color: #991b1b !important; font-weight: bold; }
.week-grid tbody td.leave-annual { background-color: #dc2626 !important; color: #ffffff !important; font-weight: bold; }
.week-grid tbody td.leave-sick { background-color: #f59e0b !important; color: #ffffff !important; font-weight: bold; }
.week-grid tbody td.leave-nopay { background-color: #64748b !important; color: #ffffff !important; font-weight: bold; }
.week-grid tbody td.leave-travel { background-color: #0891b2 !important; color: #ffffff !important; font-weight: bold; }
.week-grid tbody td.leave-pat { background-color: #8b5cf6 !important; color: #ffffff !important; font-weight: bold; }
.week-grid tbody td.leave-mat { background-color: #ec4899 !important; color: #ffffff !important; font-weight: bold; }
.week-grid tbody td.leave-frl { background-color: #0ea5e9 !important; color: #ffffff !important; font-weight: bold; }
.week-grid tbody td.leave-absent { background-color: #000000 !important; color: #ffffff !important; font-weight: bold; }
.week-grid tbody td.leave-late { background-color: #f97316 !important; color: #ffffff !important; font-weight: bold; }
.week-grid tbody td.leave-other { background-color: #94a3b8 !important; color: #ffffff !important; font-weight: bold; }

/* Admin staff auto-holiday cells (Fri / Sat / government holidays) */
.week-grid tbody td.admin-holiday {
  background-color: #fef3c7 !important;
  color: #92400e !important;
  font-weight: bold;
  font-size: 8px;
  letter-spacing: 0.3px;
}

.week-grid tbody td.out-of-period-cell { background-color: #e2e8f0 !important; color: #94a3b8 !important; }
.clickable-cell { cursor: pointer; transition: all 0.15s; }
.clickable-cell:hover { background-color: #e2e8f0 !important; border-color: #94a3b8 !important; }

/* ==================== DEPARTMENT TABS ==================== */
.dept-tabs { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; background: white; padding: 8px; border-radius: 8px; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1); }
.dept-tab { padding: 8px 16px; border: 1px solid #cbd5e1; background-color: #ffffff; color: #475569; border-radius: 6px; font-weight: 600; font-size: 13px; cursor: pointer; font-family: inherit; }
.dept-tab.active { background-color: #2563eb; color: #ffffff; border-color: #2563eb; }

/* ==================== DASHBOARD ==================== */
.dash-welcome { background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%); color: #ffffff; padding: 24px 28px; border-radius: 12px; margin-bottom: 20px; }
.dash-welcome h2 { color: #ffffff !important; font-size: 22px; margin: 0; }
.dash-welcome p { color: rgba(255, 255, 255, 0.85) !important; margin: 6px 0 0; }
.dash-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat-card { background: #ffffff; border-radius: 10px; padding: 18px 20px; display: flex; align-items: center; gap: 14px; cursor: pointer; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08); border: 1px solid #e2e8f0; }
.stat-icon { width: 48px; height: 48px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 22px; flex-shrink: 0; }
.stat-value { font-size: 24px; font-weight: 800; color: #1e293b; line-height: 1.1; }
.stat-label { font-size: 12px; color: #64748b; font-weight: 600; margin-top: 4px; }
.dash-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 900px) { .dash-grid { grid-template-columns: 1fr; } }
.dash-card { background: #ffffff; border-radius: 10px; padding: 20px 22px; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08); border: 1px solid #e2e8f0; }
.dash-card h3 { margin: 0 0 14px; font-size: 15px; color: #1e293b; font-weight: 700; }
.quick-btn { padding: 10px 16px; background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; border-radius: 6px; font-weight: 600; font-size: 13px; cursor: pointer; font-family: inherit; }
.mini-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.mini-table th, .mini-table td { padding: 8px 10px; text-align: left; border-bottom: 1px solid #e2e8f0; color: #1e293b; }
.mini-table th { background: #f8fafc; font-weight: 700; font-size: 11px; color: #475569; text-transform: uppercase; }

/* ==================== MODAL ==================== */
.modal-backdrop { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(15, 23, 42, 0.6); display: flex; align-items: center; justify-content: center; z-index: 9999; padding: 20px; backdrop-filter: blur(2px); }
.modal-content { background: #ffffff; padding: 28px; border-radius: 12px; max-width: 440px; width: 100%; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3); }
.modal-content h3 { margin: 0 0 12px; font-size: 18px; font-weight: 700; }
.modal-actions { display: flex; gap: 12px; justify-content: flex-end; }
.cancel-btn { padding: 10px 18px; background: #e2e8f0; color: #475569; border: none; border-radius: 6px; font-weight: 600; cursor: pointer; }
.modal-actions .submit-btn { padding: 10px 18px; color: #ffffff; border: none; border-radius: 6px; font-weight: 600; cursor: pointer; background: #2563eb; }

/* ==================== PRINT STYLES ==================== */
@media print {
  @page { size: A4 landscape; margin: 4mm; }

  .sidebar, .top-tabs-container, .main-app-header, .staff-header, .week-nav, .dept-tabs, .no-print, .reorder-col, .bulk-form, .staff-form {
    display: none !important;
  }

  .dashboard-layout, .main-content, .page-wrapper, .page-content {
    display: block !important; padding: 0 !important; margin: 0 !important; 
    background: #ffffff !important; overflow: visible !important; height: auto !important;
  }

  .roster-export-area {
    box-shadow: none !important; padding: 0 !important; margin: 0 !important; 
    background: #ffffff !important; border: none !important; zoom: 1 !important;
    height: 100% !important;
  }

  .roster-title { margin-bottom: 6px !important; padding: 0 !important; }
  .roster-title h1 { font-family: Arial, sans-serif !important; font-size: 14px !important; font-weight: 500 !important; margin: 0 !important; padding: 0 !important; text-transform: uppercase !important; }

  .roster-week-section { page-break-inside: avoid !important; break-inside: avoid !important; margin: 0 !important; padding: 0 !important; }
  .week-label { font-size: 10px !important; margin: 0 0 2px 0 !important; padding: 0 !important; line-height: 1 !important; font-weight: 500 !important; text-transform: uppercase !important; }

  .week-grid { width: 100% !important; table-layout: fixed !important; }
  .week-grid th, .week-grid td {
    border: 1px solid #000 !important; 
    padding: 0px 1px !important;
    text-align: center !important; 
    -webkit-print-color-adjust: exact !important; 
    print-color-adjust: exact !important;
  }

  .week-grid .col-sn { width: 45px !important; }
  .week-grid .col-name { width: 140px !important; font-size: 9px !important; }
  .week-grid .col-date { width: auto !important; }

  body.print-all .roster-title { display: none !important; }
  body.print-all .print-week-header {
    display: block !important;
    text-align: center !important;
    font-family: Arial, sans-serif !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    text-transform: uppercase !important;
    margin-bottom: 4px !important;
    margin-top: 0 !important;
    padding: 0 !important;
    color: #000 !important;
  }
  body.print-all .roster-week-section {
    page-break-after: always !important;
    break-after: page !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
    margin-bottom: 0 !important;
  }
  body.print-all .roster-week-section:last-child {
    page-break-after: auto !important;
    break-after: auto !important;
  }
  body.print-all .week-grid th, body.print-all .week-grid td {
    height: 20px !important; font-size: 10px !important; line-height: 1.1 !important;
  }
  body.print-all .week-grid thead th {
    height: 24px !important; font-size: 9px !important;
  }

  body.print-large .roster-week-section { margin-bottom: 2px !important; }
  body.print-large .week-grid th, body.print-large .week-grid td {
    height: 12px !important; font-size: 7.5px !important; line-height: 1 !important; padding: 0 !important;
  }
  body.print-large .week-grid thead th {
    height: 16px !important; font-size: 7px !important;
  }

  body.print-small .roster-week-section { margin-bottom: 10px !important; }
  body.print-small .week-grid th, body.print-small .week-grid td {
    height: 24px !important; font-size: 10px !important; line-height: 1.1 !important;
  }
  body.print-small .week-grid thead th {
    height: 28px !important; font-size: 9px !important;
  }

  .week-grid thead th { background-color: #22c55e !important; color: #ffffff !important; }
  .shift-morning { background-color: #d1fae5 !important; }
  .shift-day { background-color: #dbeafe !important; }
  .shift-afternoon { background-color: #ffedd5 !important; }
  .shift-night { background-color: #f3e8ff !important; }
  .leave-off { background-color: #fecaca !important; }
  .leave-annual { background-color: #dc2626 !important; color: #fff !important; }
  .leave-sick { background-color: #f59e0b !important; color: #fff !important; }
  .leave-nopay { background-color: #64748b !important; color: #fff !important; }
  .leave-travel { background-color: #0891b2 !important; color: #fff !important; }
  .leave-pat { background-color: #8b5cf6 !important; color: #fff !important; }
  .leave-mat { background-color: #ec4899 !important; color: #fff !important; }
  .leave-frl { background-color: #0ea5e9 !important; color: #fff !important; }
  .leave-absent { background-color: #000000 !important; color: #fff !important; }
  .leave-late { background-color: #f97316 !important; color: #fff !important; }
  .admin-holiday { background-color: #fef3c7 !important; color: #92400e !important; }
  .out-of-period-cell { background-color: #e2e8f0 !important; }
}

/* =========================================================
   MOBILE RESPONSIVE LAYOUT (STRICTLY SCREEN ONLY)
   ========================================================= */
@media screen and (max-width: 1024px) {
  .dashboard-layout {
    display: flex !important;
    flex-direction: column !important;
    width: 100vw !important;
    min-height: 100vh !important;
    overflow-x: hidden !important;
  }

  .sidebar, .main-content { display: contents !important; }

  .top-tabs-container {
    display: flex !important; order: 2 !important; width: 100% !important;
    overflow-x: auto !important; background: #fff !important; border-bottom: 2px solid #e2e8f0 !important;
  }
  .top-tab {
    flex: 1 !important; padding: 12px 10px !important; font-size: 13px !important;
    white-space: nowrap !important; text-align: center !important;
  }

  .sidebar-nav {
    display: flex !important; flex-direction: row !important; order: 3 !important;
    width: 100% !important; overflow-x: auto !important; padding: 10px !important;
    background: #f8fafc !important; border-bottom: 1px solid #e2e8f0 !important; gap: 8px !important;
  }
  .sidebar-section-title { display: none !important; }
  .nav-item {
    white-space: nowrap !important; padding: 8px 16px !important; font-size: 13px !important;
    border: 1px solid #cbd5e1 !important; background: #fff !important;
    border-radius: 20px !important; color: #475569 !important; margin: 0 !important;
  }
  .nav-item.active {
    background: #2563eb !important; color: #fff !important; border-color: #2563eb !important;
  }

  .page-wrapper {
    display: block !important; order: 4 !important; width: 100% !important;
    padding: 15px !important; flex: 1 !important;
  }

  .sidebar-footer {
    display: flex !important; flex-direction: column !important; order: 5 !important;
    width: 100% !important; background: #0f172a !important; padding: 20px !important; margin-top: auto !important;
  }
  .sidebar-footer button { width: 100% !important; padding: 12px !important; font-size: 14px !important; }

  .bulk-form-grid { grid-template-columns: 1fr !important; }
  .bulk-field-full { grid-column: span 1 !important; }

  .week-grid th, .week-grid td { font-size: 10px !important; padding: 4px 2px !important; }
  .week-grid .col-sn { width: 45px !important; min-width: 45px !important; }
  .week-grid .col-name { width: 90px !important; min-width: 90px !important; white-space: nowrap !important; overflow: hidden; text-overflow: ellipsis; }
  .week-grid .col-date { min-width: 65px !important; padding: 0 2px !important; }
}
/* (Keep all your existing CSS at the top... just update the Mobile Responsive section at the very bottom) */

/* =========================================================
   MOBILE RESPONSIVE LAYOUT (STRICTLY SCREEN ONLY)
   ========================================================= */
@media screen and (max-width: 1024px) {
  .dashboard-layout {
    display: flex !important;
    flex-direction: column !important;
    width: 100vw !important;
    min-height: 100vh !important;
    overflow-x: hidden !important;
  }

  .sidebar, .main-content { display: contents !important; }

  .top-tabs-container {
    display: flex !important; order: 2 !important; width: 100% !important;
    overflow-x: auto !important; background: #fff !important; border-bottom: 2px solid #e2e8f0 !important;
  }
  .top-tab {
    flex: 1 !important; padding: 12px 10px !important; font-size: 13px !important;
    white-space: nowrap !important; text-align: center !important;
  }

  .sidebar-nav {
    display: flex !important; flex-direction: row !important; order: 3 !important;
    width: 100% !important; overflow-x: auto !important; padding: 10px !important;
    background: #f8fafc !important; border-bottom: 1px solid #e2e8f0 !important; gap: 8px !important;
    flex-wrap: nowrap !important; /* Prevent wrapping */
  }
  .sidebar-section-title { display: none !important; }
  
  .nav-item {
    white-space: nowrap !important; padding: 8px 16px !important; font-size: 13px !important;
    border: 1px solid #cbd5e1 !important; background: #fff !important;
    border-radius: 20px !important; color: #475569 !important; margin: 0 !important;
    flex-shrink: 0 !important; /* FIX: Prevents stretching */
  }
  .nav-item.active {
    background: #2563eb !important; color: #fff !important; border-color: #2563eb !important;
  }

  .page-wrapper {
    display: block !important; order: 4 !important; width: 100% !important;
    padding: 15px !important; flex: 1 !important;
  }

  .sidebar-footer {
    display: flex !important; flex-direction: column !important; order: 5 !important;
    width: 100% !important; background: #0f172a !important; padding: 20px !important; margin-top: auto !important;
  }
  .sidebar-footer button { width: 100% !important; padding: 12px !important; font-size: 14px !important; }

  .bulk-form-grid { grid-template-columns: 1fr !important; }
  .bulk-field-full { grid-column: span 1 !important; }

  .week-grid th, .week-grid td { font-size: 10px !important; padding: 4px 2px !important; }
  .week-grid .col-sn { width: 45px !important; min-width: 45px !important; }
  .week-grid .col-name { width: 90px !important; min-width: 90px !important; white-space: nowrap !important; overflow: hidden; text-overflow: ellipsis; }
  .week-grid .col-date { min-width: 65px !important; padding: 0 2px !important; }
}
/* ==================== FLIGHT CARD RESPONSIVE FIX ==================== */
.flight-card-details {
  display: grid;
  grid-template-columns: 1fr 2fr 1fr;
  padding: 20px;
  gap: 16px;
}

@media screen and (max-width: 768px) {
  .flight-card-details {
    grid-template-columns: 1fr;
    padding: 16px;
    text-align: center;
  }
  
  /* Remove the vertical borders on mobile */
  .flight-card-details > div {
    border: none !important;
    padding: 0 !important;
    align-items: center !important;
  }
}/* src/styles/RampCheck.css */

/* ==================== SCREEN LAYOUT ==================== */
.ramp-container { background: #e2e8f0; padding: 20px; border-radius: 8px; overflow-x: auto; }
.ramp-sheet { font-family: Arial, sans-serif; font-size: 11px; color: #000; max-width: 1100px; margin: 0 auto; background: #fff; padding: 15px; box-shadow: 0 4px 6px rgba(0,0,0,0.1); border-radius: 4px; }
.ramp-sheet .flight-form { border: 1px solid #000; padding: 10px; background: #fff; }
.ramp-sheet .company-header { display: flex; flex-direction: column; align-items: center; margin-bottom: 15px; width: 100%; }
.ramp-sheet .company-header img { height: 80px; object-fit: contain; margin-bottom: 10px; }
.ramp-sheet .company-title { font-weight: bold; font-size: 16px; text-align: center; }
.ramp-sheet .company-subtitle { font-weight: bold; font-size: 14px; text-align: center; margin-top: 2px; }
.ramp-sheet .company-unit-text { font-weight: bold; font-size: 13px; text-align: left; width: 100%; margin-top: 4px; }
.ramp-sheet .title { text-align: center; font-size: 14px; font-weight: bold; text-decoration: underline; margin-bottom: 10px; margin-top: 10px; }

.ramp-sheet .main-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; margin-bottom: 15px; }
.ramp-sheet .bottom-section { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; margin-bottom: 15px; }
.ramp-sheet .bottom-section-2 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 15px; }

.ramp-sheet .inner-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.ramp-sheet .inner-table th, .ramp-sheet .inner-table td { border: 1px solid #000; padding: 3px 5px; text-align: center; vertical-align: middle; }
.ramp-sheet .inner-table th { background: #f1f5f9; font-size: 11px; font-weight: bold; }
.ramp-sheet .inner-table td:first-child { width: 45%; white-space: nowrap; text-align: left; padding-left: 8px; }
.ramp-sheet .inner-table td:nth-child(2), .ramp-sheet .inner-table td:nth-child(3) { width: 27.5%; }

.ramp-sheet .inner-table input { 
  width: 100%; max-width: 100px; margin: 0 auto; 
  border: none; text-align: center; font-family: inherit; font-size: 12px; 
  background: transparent !important; color: #000 !important; padding: 2px; 
}
.ramp-sheet .inner-table input:focus { outline: none; background: transparent !important; }
.ramp-sheet .info-table td:first-child { width: 35% !important; }
.ramp-sheet .info-table td:nth-child(2) { width: 65% !important; padding: 0 !important; }
.ramp-sheet .info-table input { max-width: 100% !important; text-align: left !important; padding-left: 8px !important; }

.ramp-sheet .special-load-textarea { width: 100%; height: 46px; border: none; background: transparent !important; font-family: inherit; font-size: 10px; resize: none; padding: 4px; text-align: left; outline: none; color: #000 !important; }
.ramp-sheet .special-load-textarea:focus { background: transparent !important; }
.ramp-sheet input[readonly], .ramp-sheet textarea[readonly] { background-color: transparent !important; color: #475569; cursor: not-allowed; border: none; }

.ramp-sheet .header-row { display: flex; margin-bottom: 4px; align-items: center; }
.ramp-sheet .header-label { font-weight: bold; width: 80px; font-size: 12px; }
.ramp-sheet .header-value { flex: 1; border-bottom: 1px solid #000; padding: 2px 4px; font-family: inherit; font-size: 12px; background: transparent !important; color: #000 !important; }
.ramp-sheet .header-value:focus { outline: none; background: transparent !important; }

.ramp-sheet .ac-type-wrapper, .ramp-sheet .route-wrapper { display: flex; flex: 1; align-items: center; gap: 5px; }
.ramp-sheet .route-wrapper { padding: 2px 5px; }
.ramp-sheet .btn-plus { background: #e2e8f0; border: 1px solid #cbd5e1; border-radius: 4px; cursor: pointer; padding: 1px 5px; font-size: 11px; font-weight: bold; color: #0f172a; }
.ramp-sheet .route-select { padding: 2px; border-radius: 4px; border: 1px solid #cbd5e1; font-size: 11px; max-width: 80px; background: #f8fafc; cursor: pointer; }

.ramp-sheet .footer-section { display: flex; gap: 15px; border-top: 1px solid #000; padding-top: 10px; flex-wrap: wrap; }
.ramp-sheet .footer-box { flex: 1; min-width: 200px; }
.ramp-sheet .footer-box label { font-weight: bold; display: block; margin-bottom: 4px; }
.ramp-sheet .footer-box textarea { width: 100%; border: 1px solid #000; padding: 5px; font-family: inherit; font-size: 12px; resize: vertical; height: 50px; background: transparent !important; color: #000 !important; }

/* ==================== MOBILE RESPONSIVE (SCREEN ONLY) ==================== */
@media screen and (max-width: 768px) {
  .ramp-container { padding: 0 !important; background: transparent !important; }
  .ramp-sheet { padding: 10px; box-shadow: none; }
  .ramp-sheet .main-grid { grid-template-columns: 1fr; gap: 10px; }
  .ramp-sheet .bottom-section { grid-template-columns: 1fr; gap: 10px; }
  .ramp-sheet .bottom-section-2 { grid-template-columns: 1fr; gap: 10px; }
  .ramp-sheet .inner-table input, .ramp-sheet .header-value { font-size: 14px; padding: 6px; height: 32px; }
  .ramp-sheet .company-header img { height: 50px; }
  .ramp-sheet .company-title { font-size: 14px; }
  .ramp-sheet .company-subtitle { font-size: 12px; }
  .no-print { flex-wrap: wrap; justify-content: center !important; }
  .no-print .quick-btn { flex: 1; min-width: 45%; font-size: 12px; }
}

/* ==========================================
   A4 PRINT LAYOUT (YOUR EXACT SNIPPET)
   ========================================== */

@page {
  size: A4 portrait;
  margin: 5mm;
}

@media print {

  html,
  body {
    width: 210mm !important;
    height: 297mm !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  /* Reset application layout */
  html,
  body,
  #root,
  .dashboard-layout,
  .main-content,
  .page-wrapper,
  .page-content,
  .modal-backdrop,
  .modal-content,
  .modal-scrollable-body {
    width: 100% !important;
    max-width: 100% !important;
    min-height: 0 !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    display: block !important;
  }

  /* Hide UI */
  .sidebar,
  .top-tabs-container,
  .main-app-header,
  .staff-header,
  .week-nav,
  .dept-tabs,
  .no-print,
  .reorder-col,
  .bulk-form,
  .staff-form,
  button,
  .quick-btn,
  .add-staff-btn,
  .export-btn,
  .ops-tabs,
  .modal-header {
    display: none !important;
  }

  /* Only show ramp sheet */
  body > #root * {
    visibility: hidden;
  }

  body.printing-ramp .ramp-container,
  body.printing-ramp .ramp-container *,
  body.printing-ramp .modal-backdrop,
  body.printing-ramp .modal-backdrop * {
    visibility: visible !important;
  }

  .ramp-container {
    padding: 0 !important;
    margin: 0 !important;
    overflow: visible !important;
    background: transparent !important;
  }

  .ramp-sheet {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;

    /* Slightly larger than before */
    zoom: 0.97;

    font-size: 10px !important;
  }

  .ramp-sheet .flight-form {
    border: 1px solid #000 !important;
    padding: 10px !important;
  }

  /* Grids */
  .ramp-sheet .main-grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px !important;
    margin-bottom: 10px !important;
  }

  .ramp-sheet .bottom-section {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px !important;
    margin-bottom: 10px !important;
  }

  .ramp-sheet .bottom-section-2 {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px !important;
    margin-bottom: 10px !important;
  }

  .ramp-sheet .bottom-section > *,
  .ramp-sheet .bottom-section-2 > *,
  .ramp-sheet .main-grid > * {
    min-width: 0 !important;
  }

  /* Header */
  .ramp-sheet .company-header {
    margin-bottom: 8px !important;
  }

  .ramp-sheet .company-header img {
    height: 50px !important;
  }

  .ramp-sheet .company-title {
    font-size: 13px !important;
  }

  .ramp-sheet .company-subtitle {
    font-size: 11px !important;
  }

  .ramp-sheet .company-unit-text {
    font-size: 10px !important;
  }

  .ramp-sheet .title {
    margin: 8px 0 !important;
    font-size: 12px !important;
  }

  /* Header rows */
  .ramp-sheet .header-row {
    margin-bottom: 4px !important;
  }

  .ramp-sheet .header-label {
    width: 65px !important;
    font-size: 10px !important;
  }

  /* Tables */
  .ramp-sheet .inner-table {
    width: 100% !important;
    table-layout: fixed !important;
  }

  .ramp-sheet .inner-table th,
  .ramp-sheet .inner-table td {
    padding: 4px 4px !important;
    font-size: 9px !important;
    line-height: 1.35 !important;
    word-break: break-word;
    overflow-wrap: break-word;
  }

  .ramp-sheet .inner-table td:first-child {
    white-space: normal !important;
  }

  /* Inputs */
  .ramp-sheet .inner-table input,
  .ramp-sheet .header-value {
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;

    height: 26px !important;
    line-height: 26px !important;

    font-size: 10px !important;
    padding: 0 2px !important;
  }

  .ramp-sheet .header-value {
    border-bottom: 1px solid #000 !important;
  }

  /* Special Load */
  .ramp-sheet .special-load-textarea {
    height: 45px !important;
    font-size: 9.5px !important;
    padding: 3px !important;
  }

  /* Footer */
  .ramp-sheet .footer-section {
    gap: 8px !important;
    padding-top: 8px !important;
  }

  .ramp-sheet .footer-box label {
    font-size: 10px !important;
  }

  .ramp-sheet .footer-box textarea {
    height: 50px !important;
    font-size: 10px !important;
    padding: 4px !important;
  }

  /* Print cleanup */
  .ramp-sheet .route-select,
  .ramp-sheet .btn-plus {
    display: none !important;
  }

  .ramp-sheet .route-wrapper {
    display: block !important;
    padding: 0 !important;
  }

  /* Allow browser to manage page fit */
  .ramp-sheet {
    page-break-inside: auto !important;
  }

  .ramp-sheet table,
  .ramp-sheet tr,
  .ramp-sheet td {
    page-break-inside: avoid !important;
  }
}/* Center everything on the screen */
.login-container {
  min-height: 100vh;
  background-color: #0f172a; /* Dark slate */
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: sans-serif;
  padding: 20px;
}

/* The white login card */
.login-box {
  background-color: #ffffff;
  padding: 40px;
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
  width: 100%;
  max-width: 420px;
}

/* Header text */
.header { text-align: center; margin-bottom: 30px; }
.header h1 { margin: 0; font-size: 28px; color: #1e293b; }
.header p { margin: 8px 0 0; color: #64748b; font-size: 14px; }

/* Role toggle buttons */
.role-toggle {
  display: flex;
  background-color: #f1f5f9;
  padding: 4px;
  border-radius: 8px;
  margin-bottom: 24px;
}
.role-toggle button {
  flex: 1;
  padding: 10px;
  border: none;
  background: none;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  color: #64748b;
  transition: all 0.2s;
}
.role-toggle button.active {
  background-color: #2563eb;
  color: #ffffff;
  box-shadow: 0 2px 4px rgba(37, 99, 235, 0.3);
}

.subtitle { color: #475569; font-size: 14px; margin-bottom: 24px; }

/* Form inputs */
.login-form { display: flex; flex-direction: column; gap: 16px; }
.input-group { display: flex; flex-direction: column; gap: 6px; }
.input-group label { font-size: 14px; font-weight: 500; color: #334155; }
.input-group input {
  padding: 10px 14px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 14px;
  outline: none;
  transition: border 0.2s;
}
.input-group input:focus { border-color: #2563eb; }

.submit-btn {
  background-color: #2563eb;
  color: white;
  border: none;
  padding: 12px;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  font-size: 16px;
  margin-top: 8px;
  transition: background 0.2s;
}
.submit-btn:hover { background-color: #1d4ed8; }

/* Footer links */
.footer-links { text-align: center; margin-top: 24px; font-size: 14px; }
.footer-links a { color: #2563eb; text-decoration: none; }
.footer-links a:hover { text-decoration: underline; }
.footer-links p { margin-top: 8px; color: #64748b; }

/* Department dropdown on login */
.login-form select {
  padding: 10px 14px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 14px;
  outline: none;
  transition: border 0.2s;
  background-color: #ffffff;
  font-family: inherit;
  color: #1e293b;
  cursor: pointer;
}
.login-form select:focus {
  border-color: #2563eb;
}:root {
  --text: #6b6375;
  --text-h: #08060d;
  --bg: #fff;
  --border: #e5e4e7;
  --code-bg: #f4f3ec;
  --accent: #aa3bff;
  --accent-bg: rgba(170, 59, 255, 0.1);
  --accent-border: rgba(170, 59, 255, 0.5);
  --social-bg: rgba(244, 243, 236, 0.5);
  --shadow: rgba(0, 0, 0, 0.1) 0 10px 15px -3px, rgba(0, 0, 0, 0.05) 0 4px 6px -2px;
  --sans: system-ui, 'Segoe UI', Roboto, sans-serif;
  --heading: system-ui, 'Segoe UI', Roboto, sans-serif;
  --mono: ui-monospace, Consolas, monospace;
  font: 18px/145% var(--sans);
  letter-spacing: 0.18px;
  color-scheme: light dark;
  color: var(--text);
  background: var(--bg);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  @media (max-width: 1024px) { font-size: 16px; }
}

@media (prefers-color-scheme: dark) {
  :root {
    --text: #9ca3af;
    --text-h: #f3f4f6;
    --bg: #16171d;
    --border: #2e303a;
    --code-bg: #1f2028;
    --accent: #c084fc;
    --accent-bg: rgba(192, 132, 252, 0.15);
    --accent-border: rgba(192, 132, 252, 0.5);
    --social-bg: rgba(47, 48, 58, 0.5);
    --shadow: rgba(0, 0, 0, 0.4) 0 10px 15px -3px, rgba(0, 0, 0, 0.25) 0 4px 6px -2px;
  }
  #social .button-icon { filter: invert(1) brightness(2); }
}

#root {
  width: 1126px;
  max-width: 100%;
  margin: 0 auto;
  text-align: center;
  border-inline: 1px solid var(--border);
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

body { margin: 0; }
h1, h2 { font-family: var(--heading); font-weight: 500; color: var(--text-h); }
h1 { font-size: 56px; letter-spacing: -1.68px; margin: 32px 0; @media (max-width: 1024px) { font-size: 36px; margin: 20px 0; } }
h2 { font-size: 24px; line-height: 118%; letter-spacing: -0.24px; margin: 0 0 8px; @media (max-width: 1024px) { font-size: 20px; } }
p { margin: 0; }
code, .counter { font-family: var(--mono); display: inline-flex; border-radius: 4px; color: var(--text-h); }
code { font-size: 15px; line-height: 135%; padding: 4px 8px; background: var(--code-bg); }

input, select, textarea { color: #1e293b !important; background-color: #ffffff !important; -webkit-text-fill-color: #1e293b !important; color-scheme: light !important; }
input:read-only, textarea:read-only, input:disabled, select:disabled { background-color: #f1f5f9 !important; color: #64748b !important; -webkit-text-fill-color: #64748b !important; }

.ramp-sheet input, .ramp-sheet textarea, .ramp-sheet select { color: #000000 !important; -webkit-text-fill-color: #000000 !important; }
.ramp-sheet input[readonly], .ramp-sheet textarea[readonly] { color: #475569 !important; -webkit-text-fill-color: #475569 !important; }

/* ==========================================
   PRINT STYLES (GLOBAL ISOLATION)
   ========================================== */
@media print {
  /* Collapse the Flexbox layout to prevent blank pages */
  html, body, #root, .dashboard-layout, .main-content, .page-wrapper, .page-content, .modal-backdrop, .modal-content, .modal-scrollable-body {
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    display: block !important; 
    flex: none !important;
  }

  /* Hide UI completely so it takes zero space */
  .sidebar, .top-tabs-container, .main-app-header, .staff-header, 
  .week-nav, .dept-tabs, .no-print, .reorder-col, .bulk-form, .staff-form,
  button, .quick-btn, .add-staff-btn, .export-btn, .ops-tabs, .modal-header {
    display: none !important;
  }

  /* Hide everything by default */
  body > #root * { visibility: hidden; }
  
  /* Show ONLY the ramp form */
  body.printing-ramp .ramp-container, 
  body.printing-ramp .ramp-container *,
  body.printing-ramp .modal-backdrop,
  body.printing-ramp .modal-backdrop * { 
    visibility: visible !important; 
  }
}