/* ==========================================================================
    APPLE DESIGN SYSTEM STYLESHEET (index.css)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
  /* Apple Color Palette */
  --bg: #F5F5F7;               /* Apple Light Grey */
  --panel: #FFFFFF;            /* Pure White */
  --panel-light: #FBFBFC;
  --line: #E5E5EA;             /* iOS Light Grey Line */
  --line-strong: #D2D2D7;
  --text: #1D1D1F;             /* Apple Jet Black */
  --muted: #86868B;            /* Apple Medium Grey */
  --accent: #0071E3;           /* Apple Link Blue */
  --accent-glow: rgba(0, 113, 227, 0.15);
  --accent-hover: #0077ED;
  --success: #34C759;          /* iOS Green */
  --danger: #FF3B30;           /* iOS Red */
  --warning: #FF9500;          /* iOS Orange */
  --radius: 12px;
  --radius-lg: 18px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.08);
  
  /* Sidebar dark titanium palette */
  --sidebar-bg: #000000;
  --sidebar-text: #E8E8ED;
  --sidebar-muted: #86868B;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  overscroll-behavior: none !important;
  overscroll-behavior-x: none !important;
  overscroll-behavior-y: none !important;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.47059;
  font-weight: 400;
  letter-spacing: -0.022em;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* Subtle page fade-in transition */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at top right, rgba(0, 113, 227, 0.03), transparent 60%);
  pointer-events: none;
  z-index: 0;
}

input, select, button, textarea {
  font-family: var(--font);
  color: inherit;
}

/* Button Standard Styles (Apple iOS-inspired) */
button {
  cursor: pointer;
  border: 1px solid var(--line-strong);
  background: #FFFFFF;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  transition: all 0.2s cubic-bezier(0.25, 1, 0.5, 1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

button:hover {
  background: #F5F5F7;
  border-color: var(--muted);
  transform: translateY(-0.5px);
}

button:active {
  transform: translateY(0.5px);
}

button.primary {
  background: var(--accent);
  color: #FFFFFF;
  border: none;
  font-weight: 600;
}

button.primary:hover {
  background: var(--accent-hover);
  box-shadow: 0 4px 12px var(--accent-glow);
}

button.danger {
  background: rgba(255, 59, 48, 0.08);
  border-color: rgba(255, 59, 48, 0.2);
  color: var(--danger);
}

button.danger:hover {
  background: var(--danger);
  color: #FFFFFF;
  border-color: var(--danger);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 11px;
  border-radius: 6px;
}

/* Disabled button state */
button.disabled-btn, button:disabled {
  background: #E5E5EA !important;
  color: #8E8E93 !important;
  border: none !important;
  cursor: not-allowed !important;
  transform: none !important;
  box-shadow: none !important;
}

/* Input Fields (Apple style with soft outline on focus) */
input, select, textarea {
  width: 100%;
  padding: 11px 14px;
  background: #FFFFFF;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  outline: none;
  font-size: 14px;
  transition: all 0.2s ease;
  color: var(--text);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.02);
}

input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-bottom: 5px;
}

/* Dynamic Viewport Container for 6.5" Phones (Employee view) */
.mobile-viewport-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100dvh;
  padding: 16px;
  width: 100%;
}

.mobile-card {
  width: 100%;
  max-width: 380px;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(20px) saturate(190%);
  -webkit-backdrop-filter: blur(20px) saturate(190%);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  overflow: hidden;
  position: relative;
}

.mobile-header {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.brand-badge {
  background: rgba(0, 113, 227, 0.08);
  color: var(--accent);
  border: 1px solid rgba(0, 113, 227, 0.15);
  font-size: 10px;
  letter-spacing: 1px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 12px;
  text-transform: uppercase;
}

.mobile-header h2 {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.mobile-header p {
  color: var(--muted);
  font-size: 13px;
}

/* ID Input Panel */
.id-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Live Onboarding and Check-In Profile Card */
.profile-preview {
  display: flex;
  align-items: center;
  gap: 14px;
  background: rgba(0, 0, 0, 0.02);
  border: 1px solid var(--line);
  padding: 12px;
  border-radius: var(--radius);
  animation: slideDown 0.3s cubic-bezier(0.25, 1, 0.5, 1);
}

.profile-img-wrap {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  flex-shrink: 0;
  background: #000;
}

.profile-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-info {
  flex: 1;
  min-width: 0;
}

.profile-name {
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-desc {
  font-size: 11px;
  color: var(--muted);
}

/* Live Camera snapping layout */
.camera-view-container {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  background: #000000;
}

.camera-view-container video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1); /* Mirror camera stream */
}

.camera-overlay-oval {
  position: absolute;
  inset: 0;
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-radius: 10px;
  pointer-events: none;
  background: radial-gradient(ellipse 55% 70% at 50% 50%, transparent 40%, rgba(0, 0, 0, 0.75) 60%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.camera-overlay-oval::after {
  content: "ALIGN FACE INSIDE OVAL";
  position: absolute;
  bottom: 12px;
  font-size: 9px;
  color: #FFFFFF;
  background: rgba(0, 0, 0, 0.7);
  padding: 4px 10px;
  border-radius: 20px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

/* Camera close button */
.cam-close-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #FFFFFF;
  font-size: 16px;
  font-weight: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  z-index: 10;
}

.cam-close-btn:hover {
  background: rgba(255, 59, 48, 0.8);
  border-color: var(--danger);
}

/* Admin Dashboard layout */
.admin-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

.sidebar {
  background: var(--sidebar-bg);
  border-right: 1px solid rgba(255, 255, 255, 0.05);
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  position: sticky;
  top: 0;
  height: 100vh;
  color: var(--sidebar-text);
  z-index: 100;
}

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 8px;
}

.sidebar-logo {
  font-size: 20px;
  font-weight: 500;
  color: #FFFFFF;
}

.sidebar-header h1 {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.nav-item {
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  padding: 10px 12px;
  color: var(--sidebar-muted);
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.15s ease;
}

.nav-item:hover {
  color: #FFFFFF;
  background: rgba(255, 255, 255, 0.05);
  transform: none;
}

.nav-item.active {
  color: #FFFFFF;
  background: var(--accent);
  box-shadow: 0 2px 8px rgba(0, 113, 227, 0.3);
}

.sidebar-footer {
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.main-content {
  padding: 32px;
  overflow-y: auto;
}

.page-header {
  margin-bottom: 24px;
}

.page-header h2 {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.025em;
}

.page-header p {
  color: var(--muted);
  font-size: 13.5px;
  margin-top: 2px;
}

/* Stats Row Dashboard grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 20px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-card label {
  margin-bottom: 0;
}

.stat-value {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.stat-value.accent {
  color: var(--accent);
}

.stat-value.success {
  color: var(--success);
}

/* Tables and Panels */
.panel-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}

.panel-title {
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 14px;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #FFFFFF;
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13.5px;
}

th, td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}

th {
  background: #F5F5F7;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: 0.05em;
}

tr:last-child td {
  border-bottom: none;
}

tr:hover td {
  background: #FAF9F9;
}

/* Forms layouts */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 12px;
}

.form-group {
  margin-bottom: 12px;
}

/* Scheduled day selector checkboxes (iOS style pills) */
.days-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.day-checkbox {
  position: relative;
}

.day-checkbox input {
  position: absolute;
  opacity: 0;
  cursor: pointer;
}

.day-checkbox span {
  display: inline-block;
  padding: 6px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  font-size: 11px;
  font-weight: 500;
  background: #FFFFFF;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
  color: var(--text);
}

.day-checkbox input:checked + span {
  background: var(--accent);
  color: #FFFFFF;
  border-color: var(--accent);
}

/* Documents / Requirements uploader row styles */
.file-list-preview {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 6px;
}

.file-preview-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--panel-light);
  border: 1px solid var(--line);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12.5px;
}

/* Sign-in overlay page */
.admin-login-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(220, 220, 225, 0.4);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

/* Layout for Registered Photo vs Checkin Photo comparison */
.photo-audit-wrap {
  display: flex;
  gap: 6px;
}

.audit-photo {
  width: 44px;
  height: 44px;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  position: relative;
  background: #000;
  cursor: zoom-in;
}

.audit-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.audit-photo::after {
  content: attr(data-label);
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 8px;
  font-weight: 600;
  text-align: center;
  padding: 1px 0;
}

/* Popups and overlays Modals styles (Apple Glassmorphism) */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(220, 220, 225, 0.4);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-content {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: var(--radius-lg);
  padding: 24px;
  width: 100%;
  max-width: 580px;
  box-shadow: var(--shadow-lg);
  max-height: 90vh;
  overflow-y: auto;
}

.modal-close {
  background: #E5E5EA;
  border: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 300;
  cursor: pointer;
  color: var(--muted);
  transition: all 0.15s ease;
}

.modal-close:hover {
  background: #D1D1D6;
  color: var(--text);
  transform: scale(1.05);
}

/* Status pill design */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 12px;
  font-size: 10.5px;
  font-weight: 600;
}

.status-pill.present {
  background: rgba(52, 199, 89, 0.08);
  color: var(--success);
  border: 1px solid rgba(52, 199, 89, 0.15);
}

.status-pill.absent {
  background: rgba(255, 59, 48, 0.08);
  color: var(--danger);
  border: 1px solid rgba(255, 59, 48, 0.15);
}

/* Page animations */
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

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

#payslip-print-section {
  display: none;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--line-strong);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--muted);
}

/* ──────────────────────────────────────────────────────────────────────────
   🖨️ PRINT STYLES FOR PHYSICALLY PRINTING PAY SLIPS
   ────────────────────────────────────────────────────────────────────────── */
@media print {
  body, .admin-layout, .mobile-viewport-wrapper, .modal-overlay {
    background: #FFFFFF !important;
    color: #000000 !important;
  }
  
  .sidebar, .main-content, button, .admin-login-overlay {
    display: none !important;
  }
  
  #payslip-print-section {
    display: block !important;
    position: absolute;
    top: 0; left: 0; width: 100%;
    margin: 0;
    padding: 20px;
    font-family: var(--font);
    background: #FFFFFF;
    color: #000000;
  }
  
  .print-header {
    text-align: center;
    border-bottom: 2px solid #000000;
    padding-bottom: 12px;
    margin-bottom: 20px;
  }
  
  .print-header h1 {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.02em;
    text-transform: uppercase;
  }
  
  .print-meta-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 20px;
    font-size: 13px;
  }
  
  .print-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
  }
  
  .print-table th, .print-table td {
    padding: 6px 8px;
    border: 1px solid #000000;
    color: #000000 !important;
    background: transparent !important;
    font-size: 11px;
  }
  
  .print-table th {
    font-weight: 600;
    text-transform: uppercase;
  }
  
  .print-total-section {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    margin-bottom: 30px;
    font-size: 13px;
  }
  
  .print-total-row {
    display: flex;
    justify-content: space-between;
    width: 240px;
    padding: 2px 0;
  }
  
  .print-total-row.grand {
    border-top: 1px solid #000000;
    border-bottom: 2px double #000000;
    font-weight: 700;
    font-size: 15px;
  }
  
  .print-signature-area {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-top: 50px;
    text-align: center;
    font-size: 12px;
  }
  
  .print-sig-line {
    border-top: 1px solid #000000;
    width: 180px;
    margin: 30px auto 0;
  }
}

/* Home Portal Selector styles */
.home-category-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 16px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.25, 1, 0.5, 1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
}

.home-category-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: 0 6px 16px rgba(0, 113, 227, 0.08);
}

.home-category-card:active {
  transform: translateY(0.5px);
}

.category-icon {
  font-size: 28px;
  width: 48px;
  height: 48px;
  border-radius: var(--radius);
  background: rgba(0, 113, 227, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--accent);
}

.home-category-card:nth-child(2) .category-icon {
  background: rgba(52, 199, 89, 0.05);
  color: var(--success);
}

.home-category-card:nth-child(3) .category-icon {
  background: rgba(255, 149, 0, 0.05);
  color: var(--warning);
}

.category-info {
  flex: 1;
}

.category-info h3 {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 2px;
}

.category-info p {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.3;
}

/* Crew Checker styles */
.crew-board-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}

.crew-card {
  background: var(--panel-light);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.crew-card-header {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  border-bottom: 1px solid var(--line);
  padding-bottom: 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.crew-member-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12.5px;
  gap: 8px;
}

.crew-member-info {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.crew-member-img {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--line-strong);
}

.crew-member-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
}

.crew-member-status {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 8px;
  font-weight: 700;
  text-transform: uppercase;
}

.crew-member-status.in {
  color: var(--success);
  background: rgba(52, 199, 89, 0.08);
  border: 1px solid rgba(52, 199, 89, 0.15);
}

.crew-member-status.out {
  color: var(--danger);
  background: rgba(255, 59, 48, 0.08);
  border: 1px solid rgba(255, 59, 48, 0.15);
}

.crew-member-status.absent {
  color: var(--muted);
  background: rgba(142, 142, 147, 0.08);
  border: 1px solid rgba(142, 142, 147, 0.15);
}

/* ──────────────────────────────────────────────────────────────────────────
   📱 RESPONSIVE & MOBILE CHROME / TOUCHSCREEN OPTIMIZATIONS
   ────────────────────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  /* Prevent inputs focus from triggering auto-zoom on iOS Chrome / Safari & optimize touch targets */
  input, select, textarea {
    font-size: 16px !important;
    min-height: 48px !important;
  }
  
  button {
    min-height: 48px !important;
    padding: 12px 20px !important;
  }

  /* Day selector checkboxes touch styling */
  .days-selector {
    gap: 12px !important;
    margin-top: 10px !important;
    margin-bottom: 10px !important;
  }
  
  .day-checkbox span {
    padding: 10px 16px !important;
    font-size: 13.5px !important;
    min-height: 44px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 22px !important;
  }

  /* Make enlisting form fields further apart on mobile */
  #onboard-form .form-group {
    margin-bottom: 18px !important;
  }

  /* Prevent horizontal squishing of inline-styled grid columns on mobile */
  .form-grid[style*="grid-template-columns"],
  div[style*="grid-template-columns"]:not([style*="repeat(7, 1fr)"]) {
    grid-template-columns: 1fr !important;
  }
  
  /* Rest days grid needs to fit on mobile screens; wraps to 4 columns */
  div[style*="repeat(7, 1fr)"] {
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 8px !important;
  }

  /* Admin Dashboard Layout Responsiveness */
  .admin-layout {
    grid-template-columns: 1fr !important;
  }
  
  .sidebar {
    display: flex !important;
    height: auto !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    padding: 10px 12px !important;
    flex-direction: column !important;
    gap: 8px !important;
    border-right: none !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15) !important;
    background: #000000 !important;
    z-index: 2000 !important;
    box-sizing: border-box !important;
  }
  
  .sidebar-header {
    width: 100% !important;
    display: flex !important;
    flex-direction: row !important;
    justify-content: space-between !important;
    align-items: center !important;
    margin-bottom: 0 !important;
  }
  
  .sidebar-logo {
    font-size: 18px !important;
  }
  
  .sidebar-header h1 {
    font-size: 16px !important;
    margin: 0 !important;
  }
  
  .sidebar-nav {
    display: flex !important;
    flex-direction: row !important;
    overflow-x: visible !important;
    width: 100% !important;
    gap: 4px !important;
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
  }
  
  .nav-item {
    flex: 1 1 0% !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    padding: 6px 2px !important;
    font-size: 10px !important;
    min-height: 48px !important;
    border-radius: 8px !important;
    gap: 3px !important;
    background: rgba(255, 255, 255, 0.03) !important;
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
  }

  .nav-item svg {
    width: 15px !important;
    height: 15px !important;
  }
  
  .sidebar-footer {
    display: none !important;
  }

  #mobile-reload-btn,
  #mobile-logout-btn {
    display: inline-block !important;
  }

  /* Reset height and enable page-level scroll on mobile to prevent missing menu */
  .main-content {
    padding: 16px !important;
    height: auto !important;
    overflow-y: visible !important;
  }
  
  .stats-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 12px !important;
  }

  /* ────────────────────────────────────────────────────────────────────────
     🎨 CLEAN MOBILE TABLE-TO-CARDS RECONSTRUCTION (Hates Excel-style wraps & scroll)
     ──────────────────────────────────────────────────────────────────────── */
  .table-wrap {
    border: none !important;
    background: transparent !important;
  }
  
  .table-wrap table, 
  .table-wrap thead, 
  .table-wrap tbody, 
  .table-wrap th, 
  .table-wrap td, 
  .table-wrap tr {
    display: block !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  .table-wrap thead {
    display: none !important; /* Hide headers on mobile */
  }
  
  .table-wrap tr {
    background: var(--panel) !important;
    border: 1px solid var(--line-strong) !important;
    border-radius: var(--radius) !important;
    padding: 16px !important;
    margin-bottom: 16px !important;
    box-shadow: var(--shadow) !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
  }
  
  .table-wrap td {
    padding: 0 !important;
    border: none !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    text-align: left !important;
    white-space: normal !important;
  }

  /* Roster Tables Card Styling Details */
  #crew-table-tbody tr, 
  #inactive-crew-table-tbody tr {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 6px !important;
    padding: 10px 12px !important;
    margin-bottom: 12px !important;
  }
  
  #crew-table-tbody td, 
  #inactive-crew-table-tbody td {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    width: 100% !important;
  }

  /* 1. Avatar (first cell) */
  #crew-table-tbody td:nth-child(1),
  #inactive-crew-table-tbody td:nth-child(1) {
    grid-column: 1 !important;
    grid-row: 1 !important;
    width: 36px !important;
    height: 36px !important;
    justify-content: flex-start !important;
    align-self: center !important;
  }
  #crew-table-tbody td:nth-child(1) img,
  #inactive-crew-table-tbody td:nth-child(1) img,
  #crew-table-tbody td:nth-child(1) div,
  #inactive-crew-table-tbody td:nth-child(1) div {
    width: 36px !important;
    height: 36px !important;
  }

  /* 2. Name & Details (second cell) */
  #crew-table-tbody td:nth-child(2),
  #inactive-crew-table-tbody td:nth-child(2) {
    grid-column: 1 / span 2 !important;
    grid-row: 1 !important;
    margin-left: 46px !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    justify-content: center !important;
    width: calc(100% - 46px) !important;
  }

  /* 3. Status Badge (fourth cell) */
  #crew-table-tbody td:nth-child(4),
  #inactive-crew-table-tbody td:nth-child(4) {
    grid-column: 2 !important;
    grid-row: 1 !important;
    justify-content: flex-end !important;
    align-self: center !important;
    width: auto !important;
  }
  #crew-table-tbody td:nth-child(4)::before,
  #inactive-crew-table-tbody td:nth-child(4)::before {
    display: none !important; /* Hide "Status" text label */
  }

  /* 4. Hide Role Column on Mobile (third cell) */
  #crew-table-tbody td:nth-child(3),
  #inactive-crew-table-tbody td:nth-child(3) {
    display: none !important;
  }

  /* 5. Payday (sixth cell) */
  #crew-table-tbody td:nth-child(6),
  #inactive-crew-table-tbody td:nth-child(6) {
    grid-column: 1 / span 2 !important;
    grid-row: 2 !important;
  }
  #crew-table-tbody td:nth-child(6)::before,
  #inactive-crew-table-tbody td:nth-child(6)::before {
    content: "Payday" !important;
    font-weight: 700 !important;
    font-size: 11px !important;
    color: var(--muted) !important;
    text-transform: uppercase !important;
    margin-right: 8px !important;
  }

  /* 6. Rates (fifth cell) */
  #crew-table-tbody td:nth-child(5),
  #inactive-crew-table-tbody td:nth-child(5) {
    grid-column: 1 / span 2 !important;
    grid-row: 3 !important;
    border-top: 1px dashed var(--line) !important;
    border-bottom: 1px solid var(--line) !important;
    padding-top: 6px !important;
    padding-bottom: 6px !important;
    margin-top: 4px !important;
    margin-bottom: 4px !important;
  }
  #crew-table-tbody td:nth-child(5)::before,
  #inactive-crew-table-tbody td:nth-child(5)::before {
    content: "Rates" !important;
    font-weight: 700 !important;
    font-size: 11px !important;
    color: var(--muted) !important;
    text-transform: uppercase !important;
  }

  /* 7. Action Buttons (seventh cell) */
  #crew-table-tbody td:nth-child(7),
  #inactive-crew-table-tbody td:nth-child(7) {
    grid-column: 1 / span 2 !important;
    grid-row: 4 !important;
    justify-content: stretch !important;
    margin-top: 4px !important;
    border-top: none !important;
    padding-top: 0 !important;
  }
  #crew-table-tbody td:nth-child(7) div,
  #inactive-crew-table-tbody td:nth-child(7) div {
    display: flex !important;
    width: 100% !important;
    gap: 6px !important;
  }
  #crew-table-tbody td:nth-child(7) button,
  #inactive-crew-table-tbody td:nth-child(7) button {
    flex: 1 !important;
    min-height: 32px !important;
    height: 32px !important;
    padding: 6px 10px !important;
    font-size: 11px !important;
    line-height: 1 !important;
  }

  /* Today's Clock Logs Card Styling Details */
  #dashboard-logs-tbody td:first-child {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 2px !important;
  }
  
  #dashboard-logs-tbody td:nth-child(2)::before { content: "Action"; font-weight: 700; font-size: 11px; color: var(--muted); text-transform: uppercase; }
  #dashboard-logs-tbody td:nth-child(3)::before { content: "Time"; font-weight: 700; font-size: 11px; color: var(--muted); text-transform: uppercase; }
  #dashboard-logs-tbody td:nth-child(4)::before { content: "Cell/Rate"; font-weight: 700; font-size: 11px; color: var(--muted); text-transform: uppercase; }
  #dashboard-logs-tbody td:nth-child(5)::before { content: "Verification"; font-weight: 700; font-size: 11px; color: var(--muted); text-transform: uppercase; }

  /* Vale Ledger Card Styling Details */
  #vale-table-tbody td:nth-child(2) {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 2px !important;
  }
  #vale-table-tbody td:first-child::before { content: "Date"; font-weight: 700; font-size: 11px; color: var(--muted); text-transform: uppercase; }
  #vale-table-tbody td:nth-child(3)::before { content: "Amount"; font-weight: 700; font-size: 11px; color: var(--muted); text-transform: uppercase; }
  #vale-table-tbody td:nth-child(4)::before { content: "Status"; font-weight: 700; font-size: 11px; color: var(--muted); text-transform: uppercase; }
  
  #vale-table-tbody td:nth-child(5) {
    justify-content: flex-end !important;
    margin-top: 8px !important;
    border-top: 1px solid var(--line) !important;
    padding-top: 12px !important;
  }

  /* Loans Ledger Card Styling Details */
  #loans-table-tbody td:nth-child(2) {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 2px !important;
  }
  #loans-table-tbody td:first-child::before { content: "Date"; font-weight: 700; font-size: 11px; color: var(--muted); text-transform: uppercase; }
  #loans-table-tbody td:nth-child(3)::before { content: "Amount"; font-weight: 700; font-size: 11px; color: var(--muted); text-transform: uppercase; }
  #loans-table-tbody td:nth-child(4)::before { content: "Terms"; font-weight: 700; font-size: 11px; color: var(--muted); text-transform: uppercase; }
  #loans-table-tbody td:nth-child(5)::before { content: "Status"; font-weight: 700; font-size: 11px; color: var(--muted); text-transform: uppercase; }
  
  #loans-table-tbody td:nth-child(6) {
    justify-content: flex-end !important;
    margin-top: 8px !important;
    border-top: 1px solid var(--line) !important;
    padding-top: 12px !important;
  }

  /* Weekly Payroll Table Card Styling Details */
  #payroll-table-tbody tr {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 6px !important;
    padding: 10px 12px !important;
    margin-bottom: 12px !important;
  }

  #payroll-table-tbody td {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    width: 100% !important;
  }

  /* 1. Name & ID (first cell) */
  #payroll-table-tbody td:nth-child(1) {
    grid-column: 1 !important;
    grid-row: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    justify-content: center !important;
  }

  /* 2. Net Due (sixth cell) */
  #payroll-table-tbody td:nth-child(6) {
    grid-column: 2 !important;
    grid-row: 1 !important;
    justify-content: flex-end !important;
    align-self: center !important;
    width: auto !important;
  }
  #payroll-table-tbody td:nth-child(6)::before {
    display: none !important; /* Hide "Net Due" text label */
  }

  /* 3. Hide Role Column on Mobile (second cell) */
  #payroll-table-tbody td:nth-child(2) {
    display: none !important;
  }

  /* 4. Days (third cell) */
  #payroll-table-tbody td:nth-child(3) {
    grid-column: 1 !important;
    grid-row: 2 !important;
  }
  #payroll-table-tbody td:nth-child(3)::before {
    content: "Days" !important;
    font-weight: 700 !important;
    font-size: 11px !important;
    color: var(--muted) !important;
    text-transform: uppercase !important;
  }

  /* 5. Gross (fourth cell) */
  #payroll-table-tbody td:nth-child(4) {
    grid-column: 1 !important;
    grid-row: 3 !important;
    border-top: 1px dashed var(--line) !important;
    padding-top: 6px !important;
    margin-top: 4px !important;
  }
  #payroll-table-tbody td:nth-child(4)::before {
    content: "Gross" !important;
    font-weight: 700 !important;
    font-size: 11px !important;
    color: var(--muted) !important;
    text-transform: uppercase !important;
  }

  /* 6. Vale (fifth cell) */
  #payroll-table-tbody td:nth-child(5) {
    grid-column: 2 !important;
    grid-row: 3 !important;
    justify-content: flex-end !important;
    border-top: 1px dashed var(--line) !important;
    padding-top: 6px !important;
    margin-top: 4px !important;
  }
  #payroll-table-tbody td:nth-child(5)::before {
    content: "Vale" !important;
    font-weight: 700 !important;
    font-size: 11px !important;
    color: var(--muted) !important;
    text-transform: uppercase !important;
    margin-right: 8px !important;
  }

  /* 7. Action Button (seventh cell) */
  #payroll-table-tbody td:nth-child(7) {
    grid-column: 1 / span 2 !important;
    grid-row: 4 !important;
    justify-content: stretch !important;
    margin-top: 4px !important;
    border-top: 1px solid var(--line) !important;
    padding-top: 8px !important;
  }
  #payroll-table-tbody td:nth-child(7) button {
    width: 100% !important;
    min-height: 32px !important;
    height: 32px !important;
    padding: 6px 12px !important;
    font-size: 11.5px !important;
    line-height: 1 !important;
  }
}

/* Touchscreen hover-state reset to avoid sticky tap styles on Mobile Chrome/Safari */
@media (hover: none) {
  button:hover {
    background: #FFFFFF !important;
    border-color: var(--line-strong) !important;
    transform: none !important;
  }
  button.primary:hover {
    background: var(--accent) !important;
    box-shadow: none !important;
    transform: none !important;
  }
  button.danger:hover {
    background: rgba(255, 59, 48, 0.08) !important;
    color: var(--danger) !important;
    border-color: rgba(255, 59, 48, 0.2) !important;
    transform: none !important;
  }
  .cam-close-btn:hover {
    background: rgba(0, 0, 0, 0.5) !important;
    border-color: rgba(255, 255, 255, 0.3) !important;
  }
  .nav-item:hover {
    color: var(--sidebar-text) !important;
    background: transparent !important;
  }
  .nav-item.active:hover {
    color: #FFFFFF !important;
    background: var(--accent) !important;
  }
  tr:hover td {
    background: transparent !important;
  }
  .modal-close:hover {
    background: #E5E5EA !important;
    color: var(--muted) !important;
    transform: none !important;
  }
  .home-category-card:hover {
    transform: none !important;
    border-color: var(--line) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02) !important;
  }
}

/* Dashboard Typography adjustments (2 points bigger) */
.admin-layout, .main-content {
  font-size: 15px !important; /* Bump base admin fonts */
}
.stat-card label {
  font-size: 13px !important; /* Was 11px */
}
.stat-value {
  font-size: 30px !important; /* Was 28px */
}
.panel-title {
  font-size: 16px !important; /* Was 14px */
}
.panel-card p, #registration-lock-card p, #payday-reminders-list p {
  font-size: 15px !important; /* Was 13px */
}
.table-wrap table th, .table-wrap table td {
  font-size: 15px !important; /* Was 13px */
}
.crew-member-name {
  font-size: 15px !important; /* Was 13px */
}
.crew-member-info span {
  font-size: 12px !important; /* Was 10px */
}

/* Registration Lock pulsing animations and classes */
.lock-status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}
.lock-status-dot.green {
  background: var(--success);
  box-shadow: 0 0 0 0 rgba(52, 199, 89, 0.4);
  animation: pulse-green 2s infinite;
}
.lock-status-dot.red {
  background: var(--danger);
  box-shadow: 0 0 0 0 rgba(255, 59, 48, 0.4);
  animation: pulse-red 2s infinite;
}
@keyframes pulse-green {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(52, 199, 89, 0.7);
  }
  70% {
    transform: scale(1);
    box-shadow: 0 0 0 8px rgba(52, 199, 89, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(52, 199, 89, 0);
  }
}
@keyframes pulse-red {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(255, 59, 48, 0.7);
  }
  70% {
    transform: scale(1);
    box-shadow: 0 0 0 8px rgba(255, 59, 48, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(255, 59, 48, 0);
  }
}

/* supervisor-only-mode layouts override sidebar display on all viewports */
.supervisor-only-mode .sidebar {
  display: none !important;
}

.supervisor-only-mode.admin-layout {
  grid-template-columns: 1fr !important;
  padding-top: 0 !important;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
.sync-icon.spinning {
  animation: spin 1s linear infinite;
}




