/* FIXED: Print logic for employee list */
:root {
  --bg-app: #F4F6FA;
  --sidebar-bg: #FFFFFF;
  --surface: #FFFFFF;
  --text-primary: #1E293B;
  --text-secondary: #64748B;
  --text-muted: #94A3B8;
  --border: #E2E8F0;
  --border-subtle: #F1F5F9;
  
  /* Brand & Accent Colors */
  --primary: #2563EB;
  --primary-light: #EFF6FF;
  --primary-dark: #1D4ED8;

  /* Card Palette from Preview */
  --card-teal: #00B69B;
  --card-amber: #FFA800;
  --card-coral: #FF5B5B;
  --card-blue: #2D74FF;

  /* Status Colors */
  --success: #10B981;
  --success-bg: #ECFDF5;
  --danger: #EF4444;
  --danger-bg: #FEF2F2;
  --warning: #F59E0B;
  --warning-bg: #FFFBEB;
  --info: #0EA5E9;
  --info-bg: #F0F9FF;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 24px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.03), 0 1px 2px rgba(0,0,0,0.02);
  --shadow-md: 0 4px 20px -2px rgba(0,0,0,0.05);
  --shadow-lg: 0 10px 25px -5px rgba(0,0,0,0.06);
  --shadow-xl: 0 20px 35px -10px rgba(37, 99, 235, 0.12);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-app);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

.mono { font-family: 'IBM Plex Mono', monospace; }

/* ================= LOGIN PAGE STYLES ================= */
.login-wrapper {
  width: 100vw;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 10% 20%, rgba(37, 99, 235, 0.08) 0%, transparent 40%),
              radial-gradient(circle at 90% 80%, rgba(0, 182, 155, 0.08) 0%, transparent 40%),
              #F4F6FA;
  padding: 24px;
}

.login-card {
  background: #FFFFFF;
  width: 100%;
  max-width: 440px;
  border-radius: var(--radius-xl);
  padding: 40px 36px 36px 36px;
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--border);
  animation: fadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.login-header {
  text-align: center;
  margin-bottom: 28px;
}
.login-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.5px;
}
.login-subtitle {
  font-size: 11px;
  color: var(--text-secondary);
  opacity: 0.65;
  margin-top: 4px;
}

.input-with-icon {
  position: relative;
  display: flex;
  align-items: center;
}
.input-with-icon svg.field-icon {
  position: absolute;
  left: 14px;
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  pointer-events: none;
}
.input-with-icon input {
  padding-left: 42px;
  padding-right: 42px;
}
.toggle-pwd-btn {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
}
.toggle-pwd-btn:hover { color: var(--text-primary); }

.login-alert {
  padding: 10px 14px;
  border-radius: 10px;
  background: #FEF2F2;
  border: 1px solid #FECACA;
  color: #DC2626;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ================= APP LAYOUT & SHELL ================= */
.app-shell {
  display: flex;
  width: 100vw;
  min-height: 100vh;
  position: relative;
}

/* Sidebar Styling - Fixed Position on Scroll */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 260px;
  height: 100vh;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 20px 16px;
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 100;
  transition: left 0.3s ease;
}

.sidebar::-webkit-scrollbar {
  width: 5px;
}
.sidebar::-webkit-scrollbar-track {
  background: transparent;
}
.sidebar::-webkit-scrollbar-thumb {
  background: #CBD5E1;
  border-radius: 4px;
}
.sidebar::-webkit-scrollbar-thumb:hover {
  background: #94A3B8;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 12px;
  margin-bottom: 32px;
}
.sidebar-logo-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, #2563EB, #00B69B);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 800;
  font-size: 18px;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}
.sidebar-logo-text {
  font-weight: 800;
  font-size: 19px;
  color: var(--text-primary);
  letter-spacing: -0.5px;
}

.sidebar-section-title {
  font-size: 11px;
  font-weight: 800;
  color: var(--text-muted);
  letter-spacing: 0.8px;
  text-transform: uppercase;
  padding: 0 12px;
  margin-bottom: 8px;
}

.nav-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 24px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 13.5px;
  text-decoration: none;
  transition: all 0.2s ease;
  cursor: pointer;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
}
.nav-item svg {
  width: 18px;
  height: 18px;
  stroke-width: 2;
  color: var(--text-muted);
  transition: color 0.2s ease;
}
.nav-item:hover {
  background: var(--primary-light);
  color: var(--primary);
}
.nav-item:hover svg { color: var(--primary); }

.nav-item.active {
  background: var(--primary);
  color: #FFFFFF;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.3);
}
.nav-item.active svg { color: #FFFFFF; }

.sidebar-footer {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--border-subtle);
}
.logout-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  color: var(--danger);
  background: var(--danger-bg);
  border: 1px solid #FECACA;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.logout-btn:hover {
  background: #FEE2E2;
}

/* Main Layout Wrapper */
.main-wrapper {
  margin-left: 260px;
  width: calc(100% - 260px);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 100vh;
  background: var(--bg-app);
}

/* Top Navbar */
.top-navbar {
  height: 72px;
  background: #FFFFFF;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  position: sticky;
  top: 0;
  z-index: 10;
}
.page-heading h1 {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-primary);
}
.page-heading p {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 1px;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.search-box {
  position: relative;
  width: 260px;
}
.search-box input {
  width: 100%;
  height: 40px;
  padding: 0 38px 0 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-app);
  font-size: 13px;
  outline: none;
  transition: all 0.2s ease;
}
.search-box input:focus {
  background: #FFFFFF;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}
.search-box .search-btn {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.icon-action-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: #FFFFFF;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  transition: all 0.2s ease;
}
.icon-action-btn:hover {
  background: var(--primary-light);
  color: var(--primary);
  border-color: #BFDBFE;
}
.notif-badge-pill {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--danger);
  color: white;
  font-size: 10px;
  font-weight: 800;
  height: 18px;
  min-width: 18px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  border: 2px solid #FFFFFF;
}

.user-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 12px 4px 4px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: #FFFFFF;
  cursor: pointer;
}
.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2563EB, #1D4ED8);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12px;
}
.user-info-text { display: flex; flex-direction: column; }
.user-name { font-size: 12px; font-weight: 700; color: var(--text-primary); }

/* Content Body */
.content-body {
  padding: 28px 32px;
  flex: 1;
}

/* UI BUTTONS & INPUTS */
.btn-ui {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  border: 1.5px solid transparent;
  outline: none;
  white-space: nowrap;
}
.btn-primary {
  background: var(--primary);
  color: #FFFFFF;
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}
.btn-primary:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.35);
}
.btn-light {
  background: #FFFFFF;
  color: var(--text-primary);
  border-color: var(--border);
}
.btn-light:hover {
  background: var(--border-subtle);
  border-color: #CBD5E1;
}
.btn-danger-light {
  background: var(--danger-bg);
  color: var(--danger);
  border-color: #FECACA;
}
.btn-danger-light:hover {
  background: #FEE2E2;
}
.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
  border-radius: var(--radius-sm);
}

.form-control {
  width: 100%;
  height: 42px;
  padding: 0 14px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border);
  background: #FFFFFF;
  font-size: 13.5px;
  color: var(--text-primary);
  outline: none;
  transition: all 0.2s ease;
  font-family: inherit;
}
.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}
.form-group label {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-secondary);
}

/* CARDS & CONTAINERS */
.card-box {
  background: #FFFFFF;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 24px;
}
.card-header-flex {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.card-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--text-primary);
}

/* VIBRANT STAT CARDS (DASHBOARD) */
.stat-grid-preview {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 24px;
}
@media (max-width: 1024px) { .stat-grid-preview { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .stat-grid-preview { grid-template-columns: 1fr; } }

.stat-card-vibrant {
  border-radius: var(--radius-lg);
  padding: 22px;
  color: white;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 120px;
}
.stat-card-teal { background: linear-gradient(135deg, #00B69B 0%, #059669 100%); }
.stat-card-amber { background: linear-gradient(135deg, #FFA800 0%, #D97706 100%); }
.stat-card-coral { background: linear-gradient(135deg, #FF5B5B 0%, #DC2626 100%); }
.stat-card-blue { background: linear-gradient(135deg, #2D74FF 0%, #1D4ED8 100%); }

.stat-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}
.stat-card-title {
  font-size: 12px;
  font-weight: 700;
  opacity: 0.9;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.stat-card-num {
  font-size: 32px;
  font-weight: 800;
  line-height: 1.1;
  margin-top: 4px;
}
.stat-circle-badge {
  background: rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(8px);
  padding: 4px 12px;
  border-radius: 50px;
  font-size: 11px;
  font-weight: 800;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
.stat-bottom-text {
  font-size: 11px;
  font-weight: 600;
  opacity: 0.9;
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* CHARTS & GRIDS */
.grid-2-1 {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
  margin-bottom: 24px;
}
.grid-1-1 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 24px;
}
@media (max-width: 1024px) {
  .grid-2-1, .grid-1-1 { grid-template-columns: 1fr; }
}

/* Segmented Chart Styling */
.segmented-chart-container {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  height: 200px;
  padding-top: 20px;
  gap: 12px;
}
.chart-bar-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  height: 100%;
  justify-content: flex-end;
}
.bar-pillar {
  width: 100%;
  max-width: 24px;
  border-radius: 6px;
  overflow: hidden;
  display: flex;
  flex-direction: column-reverse;
  background: var(--border-subtle);
}
.bar-seg { width: 100%; transition: height 0.3s ease; }
.seg-teal { background: #38BDF8; }
.seg-yellow { background: #FFA800; }
.seg-coral { background: #FF5B5B; }
.chart-month-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  margin-top: 8px;
}

.chart-legend {
  display: flex;
  gap: 14px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
}
.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 4px;
}

/* RECENT ACTIVITY & LISTS */
.recent-list { display: flex; flex-direction: column; gap: 12px; }
.recent-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  transition: background 0.2s ease;
}
.recent-item:hover { background: #F8FAFC; }
.recent-left { display: flex; align-items: center; gap: 12px; }
.recent-title { font-size: 13px; font-weight: 700; color: var(--text-primary); }
.recent-sub { font-size: 11px; color: var(--text-muted); }

.activity-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-subtle);
}
.activity-row:last-child { border-bottom: none; }
.activity-user { display: flex; align-items: center; gap: 12px; }

/* CHIPS & TAGS */
.tag-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
}
.tag-green { background: #DCFCE7; color: #15803D; }
.tag-red { background: #FEE2E2; color: #B91C1C; }
.tag-amber { background: #FEF3C7; color: #B45309; }
.tag-blue { background: #E0F2FE; color: #0369A1; }
.tag-purple { background: #F3E8FF; color: #6B21A8; }
.tag-gray { background: #F1F5F9; color: #64748B; }

.code-badge-chip {
  padding: 4px 8px;
  border-radius: 6px;
  font-weight: 800;
  font-size: 11px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* CUSTOM TABLE STYLES */
.table-responsive { width: 100%; overflow-x: auto; }
.custom-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.custom-table th {
  background: var(--bg-app);
  color: var(--text-secondary);
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.custom-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-primary);
}
.custom-table tbody tr:hover { background: #F8FAFC; }

/* POINTAGE CALENDAR GRID */
.pointage-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  margin-top: 14px;
}
@media (max-width: 768px) {
  .pointage-calendar-grid { grid-template-columns: repeat(3, 1fr); }
}
.pointage-day-box {
  border-radius: var(--radius-md);
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: all 0.2s ease;
}
.day-top-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.day-num { font-size: 13px; font-weight: 800; }
.day-wk { font-size: 10px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; }

/* MODALS & OVERLAYS */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}
.modal-card {
  background: #FFFFFF;
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 520px;
  padding: 24px;
  box-shadow: var(--shadow-xl);
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
}
.modal-card-lg { max-width: 820px; }

/* NOTIFICATIONS PANEL */
.notif-panel {
  position: fixed;
  top: 80px;
  right: 32px;
  width: 380px;
  background: #FFFFFF;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-xl);
  padding: 16px;
  z-index: 90;
  animation: fadeIn 0.2s ease;
}
.banner-alert-box {
  background: #FFFBEB;
  border: 1.5px solid #FDE68A;
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* PROGRESS BAR */
.progress-track {
  width: 100%;
  height: 8px;
  background: var(--border-subtle);
  border-radius: 4px;
  overflow: hidden;
  margin-top: 8px;
}
.progress-bar-fill { height: 100%; border-radius: 4px; transition: width 0.4s ease; }

/* PHOTO UPLOAD */
.photo-upload-container {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
  padding: 12px;
  background: var(--bg-app);
  border-radius: var(--radius-md);
}
.photo-preview-circle {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: var(--text-muted);
  overflow: hidden;
}
.photo-preview-circle img { width: 100%; height: 100%; object-fit: cover; }

/* OFFICIAL GTP PRINT SLIP STYLES - SINGLE A5 FORMAT (210mm x 148.5mm) */
.official-print-document {
  background: #FFFFFF;
  border: 2px solid #000000;
  padding: 16px;
  color: #000000;
  font-family: Arial, sans-serif;
  box-sizing: border-box;
}
.gtp-header-table {
  width: 100%;
  border-collapse: collapse;
  border-bottom: 2px solid #000000;
  margin-bottom: 12px;
}
.gtp-header-table td {
  border: 1px solid #000000;
  padding: 6px;
  text-align: center;
}
.gtp-logo-cell { width: 100px; }
.gtp-circle-logo {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid #0066CC;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
}
.gtp-title-cell h1 {
  font-size: 18px;
  font-weight: 900;
  margin: 0;
  letter-spacing: 1px;
}
.gtp-ref-cell { font-size: 10px; text-align: left !important; width: 140px; }
.gtp-ref-line { margin-bottom: 2px; }
.gtp-reasons-block {
  display: flex;
  gap: 30px;
  margin-bottom: 12px;
  font-size: 12px;
  font-weight: 700;
}
.gtp-reason-row { display: flex; align-items: center; gap: 8px; }
.gtp-square {
  width: 16px;
  height: 16px;
  border: 1px solid #000;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
}
.gtp-line-row {
  display: flex;
  align-items: flex-end;
  margin-bottom: 8px;
  font-size: 12px;
}
.gtp-line-row .lbl { font-weight: 700; margin-right: 8px; white-space: nowrap; }
.gtp-line-row .dot-fill {
  flex: 1;
  border-bottom: 1px dotted #000;
  font-weight: 700;
  padding-left: 6px;
}
.gtp-signature-area {
  margin-top: 24px;
  text-align: right;
  font-size: 11px;
  font-weight: 700;
  padding-right: 20px;
}
.gtp-footer-section { margin-top: 16px; border-top: 1px solid #000; padding-top: 6px; font-size: 9px; }
.gtp-meta-line { display: flex; justify-content: space-between; margin-bottom: 4px; }
.gtp-disclaimer-text { text-align: center; font-weight: 700; }

@media print {
  @page {
    size: A4 portrait;
    margin: 10mm;
  }
  
  /* Hide main application UI to prevent blank pages */
  body:not(.print-full-page) .sidebar,
  body:not(.print-full-page) .main-wrapper,
  body:not(.print-full-page) .notif-panel {
    display: none !important;
  }

  body:not(.print-full-page) {
    background: transparent !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  .modal-overlay {
    position: static !important;
    background: transparent !important;
    padding: 0 !important;
    margin: 0 !important;
    display: block !important;
  }

  .print-slip {
    position: relative !important;
    width: 190mm !important;
    height: 148.5mm !important;
    box-shadow: none !important;
    border: 1px solid #000 !important;
    padding: 16px !important;
    margin: 0 auto !important;
    overflow: hidden !important;
    background: #FFF !important;
    transform: none !important;
    left: auto !important;
    top: auto !important;
  }

  .print-landscape {
    position: relative !important;
    width: 100% !important;
    max-width: none !important;
    min-height: 100% !important;
    box-shadow: none !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
    background: #FFF !important;
    transform: none !important;
    left: auto !important;
    top: auto !important;
    zoom: 1.35 !important;
  }

  .no-print { display: none !important; }
}

.stat-rank-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.stat-rank-table th {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 700;
  padding: 8px 12px;
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.stat-rank-table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-weight: 500;
}
.stat-rank-table tr:hover td { background: #F8FAFC; }
.rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 800;
  background: var(--primary-light);
  color: var(--primary);
}
.rank-badge.rank-1 { background: #FFF7E6; color: #D97706; }
.rank-badge.rank-2 { background: #F1F5F9; color: #475569; }
.rank-badge.rank-3 { background: #FFF1F2; color: #E11D48; }

.bon-sortie-card-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}
@media (max-width: 900px) { .bon-sortie-card-grid { grid-template-columns: 1fr; } }
.type-toggle-group {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}
.type-toggle-btn {
  flex: 1;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1.5px solid var(--border);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  background: #FFFFFF;
  color: var(--text-secondary);
  transition: all 0.2s;
  text-align: center;
}
.type-toggle-btn.selected {
  border: 2px solid var(--primary);
  background: var(--primary-light);
  color: var(--primary);
}

/* SUB TABS STYLING */
.sub-tab-group {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  border-bottom: 2px solid var(--border-subtle);
  padding-bottom: 10px;
}
.sub-tab-btn {
  padding: 8px 18px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  border: 1.5px solid var(--border);
  background: #FFFFFF;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
}
.sub-tab-btn.active {
  background: var(--primary);
  color: #FFFFFF;
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

/* HELP MODAL ACCORDION */
.faq-accordion-item {
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 10px;
  overflow: hidden;
}
.faq-header {
  padding: 14px 16px;
  background: #F8FAFC;
  font-weight: 700;
  font-size: 13.5px;
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.faq-body {
  padding: 14px 16px;
  background: #FFFFFF;
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.6;
  border-top: 1px solid var(--border-subtle);
  display: block;
  visibility: visible;
  opacity: 1;
}

/* ================= MOBILE RESPONSIVENESS ================= */
.menu-toggle-btn {
  display: none;
  background: none;
  border: none;
  font-size: 24px;
  color: var(--text-primary);
  cursor: pointer;
  padding: 4px;
  margin-right: 12px;
}
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(2px);
  z-index: 15;
}

@media (max-width: 768px) {
  .menu-toggle-btn { display: inline-flex; align-items: center; justify-content: center; }
  .sidebar {
    position: fixed;
    top: 0;
    left: -280px;
    height: 100vh;
    box-shadow: var(--shadow-xl);
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }
  .sidebar.open { left: 0; }
  .sidebar-overlay.open { display: block; }
  .main-wrapper { margin-left: 0; width: 100%; }
  
  .top-navbar { padding: 0 16px; height: 64px; }
  .content-body { padding: 16px; }
  .search-box { width: 140px; } /* Shrink search on mobile */
  .page-heading h1 { font-size: 16px; }
  
  /* Convert tables to cards */
  .custom-table, .custom-table thead, .custom-table tbody, .custom-table th, .custom-table td, .custom-table tr {
    display: block;
  }
  .custom-table thead tr {
    position: absolute;
    top: -9999px;
    left: -9999px;
  }
  .custom-table tr {
    margin-bottom: 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: #FFF;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
  }
  .custom-table td {
    border: none;
    border-bottom: 1px solid var(--border-subtle);
    position: relative;
    padding-left: 45%;
    min-height: 40px;
  }
  .custom-table td:before {
    position: absolute;
    top: 12px;
    left: 12px;
    width: 40%;
    padding-right: 10px;
    white-space: nowrap;
    font-weight: 700;
    color: var(--text-muted);
    font-size: 11px;
    text-transform: uppercase;
    content: attr(data-label); /* Requires data-label in HTML */
  }
}

