/* ==========================================================================
   Low Cost Technical Services LLC — Workforce Management System
   VIP Corporate Theme: Crimson Red, Charcoal, Gold
   (Google Font loaded non-blockingly in HTML for instant iOS/Android render)
   ========================================================================== */

:root {
  --primary: #1a1a1a;
  --primary-light: #2d2d2d;
  --accent: #CC1416;
  --accent-light: #e53e3e;
  --accent-soft: #fff0f0;
  --gold: #C9A84C;
  --gold-soft: #fdf6e3;

  --blue: #2563eb;
  --blue-soft: #dbeafe;
  --green: #059669;
  --green-soft: #d1fae5;
  --red: #CC1416;
  --red-soft: #fff0f0;
  --purple: #7c3aed;
  --purple-soft: #ede9fe;

  --bg: #f8fafc;
  --surface: #ffffff;
  --border: #e2e8f0;
  --text-main: #1a1a1a;
  --text-muted: #64748b;
  --text-light: #94a3b8;

  --sidebar-w: 265px;
  --header-h: 70px;
  --radius: 10px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow: 0 4px 6px -1px rgba(0,0,0,0.08), 0 2px 4px -2px rgba(0,0,0,0.05);
  --shadow-lg: 0 10px 25px -5px rgba(0,0,0,0.12), 0 8px 10px -6px rgba(0,0,0,0.08);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  max-width: 100%;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  max-width: 100%;
  overflow-x: clip;
}

/* ── Typography ── */
h1, h2, h3, h4 { color: var(--text-main); font-weight: 700; line-height: 1.25; }
h1 { font-size: 1.75rem; }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.15rem; }
p { color: var(--text-muted); font-size: 0.92rem; }
a { text-decoration: none; color: inherit; }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: var(--radius);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s ease;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }

.btn-primary {
  background: linear-gradient(135deg, #CC1416, #8B0000);
  color: #fff;
  box-shadow: 0 2px 8px rgba(204,20,22,0.25);
}
.btn-primary:hover { background: linear-gradient(135deg, #e01a1c, #a00000); box-shadow: 0 4px 14px rgba(204,20,22,0.35); }

.btn-accent { background: var(--gold); color: #fff; }
.btn-accent:hover { background: #b8923c; }

.btn-secondary { background: #fff; color: var(--text-main); border-color: var(--border); }
.btn-secondary:hover { background: #f1f5f9; border-color: #cbd5e1; }

.btn-success { background: var(--green); color: #fff; }
.btn-success:hover { background: #047857; }
.btn-warning { background: #d97706; color: #fff; }
.btn-warning:hover { background: #b45309; }

.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { background: #a00000; }

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

/* ── Layout ── */
.app-container {
  display: flex;
  min-height: 100vh;
  min-height: 100dvh;
  width: 100%;
  max-width: 100%;
}

/* ── Sidebar ── */
.sidebar {
  width: var(--sidebar-w);
  background: linear-gradient(180deg, #1a1a1a 0%, #111111 100%);
  color: #fff;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
  transition: transform 0.25s ease;
  box-shadow: 4px 0 20px rgba(0,0,0,0.3);
}

.sidebar-header {
  padding: 20px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 2px solid #CC1416;
  background: rgba(204,20,22,0.05);
}

.brand-badge {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: white;
  border: 2px solid #CC1416;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

.brand-text h2 { font-size: 0.95rem; color: #fff; letter-spacing: -0.2px; line-height: 1.3; }
.brand-text p { font-size: 0.68rem; color: #CC1416; font-weight: 600; text-transform: uppercase; letter-spacing: 0.8px; margin-top: 2px; }

/* Gold separator after sidebar header */
.sidebar-header::after {
  display: none;
}

.sidebar-menu {
  flex: 1;
  padding: 16px 10px;
  overflow-y: auto;
  list-style: none;
}

.menu-title {
  font-size: 0.65rem;
  font-weight: 700;
  color: #4a4a4a;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  padding: 14px 14px 6px;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  margin-bottom: 3px;
  border-radius: var(--radius);
  color: #9a9a9a;
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.menu-item:hover { background: rgba(204,20,22,0.1); color: #fff; }
.menu-item.active {
  background: linear-gradient(135deg, #CC1416, #8B0000);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 4px 14px rgba(204,20,22,0.35);
}
.menu-item svg { width: 18px; height: 18px; flex-shrink: 0; }

.sidebar-footer {
  padding: 16px 18px;
  border-top: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(0,0,0,0.2);
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
}
.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #CC1416, #8B0000);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.88rem;
  border: 2px solid #C9A84C;
  flex-shrink: 0;
}
.user-info { overflow: hidden; }
.user-name { font-size: 0.84rem; font-weight: 600; color: #fff; white-space: nowrap; text-overflow: ellipsis; }
.user-role { font-size: 0.7rem; color: #CC1416; font-weight: 600; }

.btn-logout {
  background: transparent;
  border: none;
  color: #666;
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  transition: all 0.2s;
}
.btn-logout:hover { color: #ef4444; background: rgba(239,68,68,0.1); }

/* ── Main Content ── */
.main-wrapper {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-width: 0;
  max-width: 100%;
  overflow-x: clip;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* ── Page Watermark ── */
.page-watermark {
  position: fixed;
  top: 50%;
  left: calc(50% + 132px);
  transform: translate(-50%, -50%);
  opacity: 0.04;
  z-index: 0;
  pointer-events: none;
  width: 480px;
}
.page-watermark svg { width: 100%; height: auto; }

.header {
  height: var(--header-h);
  background: var(--surface);
  border-bottom: 3px solid #f0f0f0;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 90;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

/* Gold accent line at top of header */
.header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #CC1416, #C9A84C, #CC1416);
}

.header-title h1 { font-size: 1.3rem; }
.header-title p { font-size: 0.78rem; }

.header-right {
  display: flex;
  align-items: center;
  gap: 14px;
}
.header-date-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f8fafc;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--primary);
  border: 1px solid var(--border);
}

.content-body {
  padding: 26px 30px;
  flex: 1;
  min-width: 0;
  max-width: 100%;
  position: relative;
  z-index: 1;
}

/* ── View Sections ── */
.view-section {
  display: none;
  min-width: 0;
  max-width: 100%;
}
.view-section.active { display: block; animation: fadeIn 0.2s ease; }

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

/* ── KPI Cards ── */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  border-left: 4px solid transparent;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-left-color: #CC1416; }

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.stat-icon svg { width: 22px; height: 22px; }
.stat-icon.blue { background: var(--blue-soft); color: var(--blue); }
.stat-icon.green { background: var(--green-soft); color: var(--green); }
.stat-icon.red { background: var(--red-soft); color: var(--red); }
.stat-icon.amber { background: var(--gold-soft); color: var(--gold); }
.stat-icon.purple { background: var(--purple-soft); color: var(--purple); }

.stat-details .label { font-size: 0.78rem; color: var(--text-muted); font-weight: 500; }
.stat-details .value { font-size: 1.5rem; font-weight: 700; color: var(--text-main); line-height: 1.2; }
.stat-details .sub { font-size: 0.73rem; color: var(--text-light); margin-top: 3px; }

/* ── Cards ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  margin-bottom: 22px;
  overflow: hidden;
  min-width: 0;
  max-width: 100%;
}

.card-header {
  padding: 16px 22px;
  border-bottom: 1px solid var(--border);
  border-left: 4px solid #CC1416;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  background: #fff;
}
.card-header h3 { font-size: 1.02rem; }
.card-body { padding: 18px 22px; }

/* ── Filter / Action Bars ── */
.action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.form-control {
  padding: 8px 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.87rem;
  color: var(--text-main);
  background: #fff;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.form-control:focus { border-color: #CC1416; box-shadow: 0 0 0 3px rgba(204,20,22,0.12); }

/* ── Tables ── */
.table-responsive {
  display: block;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x pan-y;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.87rem;
}

.data-table th {
  background: #f8fafc;
  padding: 11px 15px;
  font-weight: 600;
  color: var(--text-muted);
  border-bottom: 2px solid var(--border);
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.data-table td {
  padding: 13px 15px;
  border-bottom: 1px solid var(--border);
  color: var(--text-main);
  vertical-align: middle;
}

.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: #fff8f8; }

/* ── Badges ── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 12px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.badge-green { background: var(--green-soft); color: #065f46; }
.badge-red { background: var(--red-soft); color: #9b1c1c; }
.badge-amber { background: var(--gold-soft); color: #78350f; }
.badge-purple { background: var(--purple-soft); color: #5b21b6; }
.badge-gray { background: #f1f5f9; color: #475569; }
.badge-blue { background: var(--blue-soft); color: #1e40af; }

.currency-aed {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.currency-aed::before {
  content: 'AED ';
  font-size: 0.74em;
  font-weight: 500;
  color: var(--text-muted);
}

/* ── Modals ── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10,10,10,0.65);
  backdrop-filter: blur(3px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.modal-backdrop.show,
.modal-backdrop.open { opacity: 1; pointer-events: auto; }

.modal-box {
  background: var(--surface);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.96);
  transition: transform 0.2s ease;
  border-top: 4px solid #CC1416;
}
.modal-backdrop.show .modal-box,
.modal-backdrop.open .modal-box { transform: scale(1); }
.modal-box.modal-lg { max-width: 820px; }

.modal-header {
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-header h3 { font-size: 1.1rem; }
.btn-close-modal {
  background: transparent;
  border: none;
  font-size: 1.4rem;
  color: var(--text-light);
  cursor: pointer;
  line-height: 1;
}
.btn-close-modal:hover { color: var(--text-main); }

.modal-body { padding: 22px; }

.modal-footer {
  padding: 14px 22px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  background: #f8fafc;
  border-radius: 0 0 16px 16px;
}

/* ── Forms ── */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.form-group.col-full { grid-column: span 2; }
.form-label {
  font-size: 0.81rem;
  font-weight: 600;
  color: var(--text-main);
}
.form-label .req { color: var(--red); }

/* ── Document Upload Zone ── */
.doc-upload-zone {
  border: 2px dashed #e2e8f0;
  border-radius: 10px;
  padding: 22px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}
.doc-upload-zone:hover {
  border-color: #CC1416;
  background: #fff8f8;
}

/* ── Payslip ── */
.payslip-sheet {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 30px;
  color: var(--text-main);
}
.payslip-header {
  display: flex;
  justify-content: space-between;
  border-bottom: 3px solid #CC1416;
  padding-bottom: 14px;
  margin-bottom: 18px;
}
.payslip-header h2 { color: #CC1416; font-size: 1.3rem; }
.payslip-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  background: #f8fafc;
  padding: 14px;
  border-radius: 8px;
  margin-bottom: 18px;
  font-size: 0.87rem;
  border-left: 4px solid #CC1416;
}
.payslip-calc-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 20px;
}
.payslip-calc-table th, .payslip-calc-table td {
  padding: 9px 13px;
  border-bottom: 1px solid var(--border);
}
.payslip-total-box {
  background: linear-gradient(135deg, #CC1416, #8B0000);
  color: #fff;
  padding: 16px 22px;
  border-radius: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 1.15rem;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(204,20,22,0.3);
}

/* ── Toast ── */
.toast-box {
  position: fixed;
  bottom: 22px;
  right: 22px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.toast-msg {
  padding: 11px 18px;
  border-radius: 8px;
  color: #fff;
  font-size: 0.87rem;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  animation: slideIn 0.2s ease;
  display: flex;
  align-items: center;
  gap: 10px;
}
.toast-msg.success { background: var(--green); }
.toast-msg.error { background: #CC1416; }
.toast-msg.info { background: var(--primary); }

@keyframes slideIn {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

/* ══ LOGIN PAGE ════════════════════════════════════════════════════════════ */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0f0f0f 0%, #1a1a1a 45%, #2d0608 100%);
  padding: 24px;
  position: relative;
  overflow: hidden;
}

/* Animated background rings */
.login-wrap::before {
  content: '';
  position: absolute;
  top: -120px;
  right: -120px;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(204,20,22,0.18) 0%, transparent 70%);
  border-radius: 50%;
  animation: pulse-glow 4s ease-in-out infinite;
}
.login-wrap::after {
  content: '';
  position: absolute;
  bottom: -100px;
  left: -100px;
  width: 350px;
  height: 350px;
  background: radial-gradient(circle, rgba(204,20,22,0.12) 0%, transparent 70%);
  border-radius: 50%;
  animation: pulse-glow 4s ease-in-out infinite 2s;
}

@keyframes pulse-glow {
  0%, 100% { transform: scale(1); opacity: 0.8; }
  50% { transform: scale(1.1); opacity: 1; }
}

.login-bg-logo {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  opacity: 0.045;
  width: 560px;
  max-width: 85vw;
  pointer-events: none;
}

.login-card {
  width: 100%;
  max-width: 450px;
  background: #ffffff;
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 30px 70px rgba(0,0,0,0.5), 0 0 60px rgba(204,20,22,0.15);
  position: relative;
  z-index: 1;
}

.login-card-top-bar {
  height: 4px;
  background: linear-gradient(90deg, #CC1416, #C9A84C, #CC1416);
}

.login-card-body {
  padding: 38px 36px;
}

.login-logo-area {
  text-align: center;
  margin-bottom: 26px;
}

.login-company-name {
  font-size: 1.0rem;
  font-weight: 800;
  color: #CC1416;
  letter-spacing: 0.3px;
  line-height: 1.3;
  margin-top: 10px;
}

.login-company-sub {
  font-size: 0.72rem;
  color: #888;
  margin-top: 3px;
  font-style: italic;
}

.login-gold-line {
  height: 1px;
  background: linear-gradient(90deg, transparent, #C9A84C, transparent);
  margin: 14px 0;
}

.login-system-title {
  font-size: 0.72rem;
  color: #aaa;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  text-align: center;
  margin-bottom: 24px;
}

.login-heading {
  font-size: 1.35rem;
  font-weight: 700;
  color: #1a1a1a;
  margin-bottom: 6px;
}
.login-subheading {
  font-size: 0.83rem;
  color: #666;
  margin-bottom: 22px;
}

.login-input-group {
  margin-bottom: 14px;
}
.login-input-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: #333;
  margin-bottom: 5px;
  display: block;
}
.login-input {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  font-size: 0.9rem;
  color: #1a1a1a;
  background: #fafafa;
  outline: none;
  transition: all 0.2s;
  font-family: inherit;
}
.login-input:focus {
  border-color: #CC1416;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(204,20,22,0.1);
}

.login-btn {
  width: 100%;
  padding: 13px;
  background: linear-gradient(135deg, #CC1416, #8B0000);
  color: #fff;
  border: none;
  border-radius: 11px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 8px;
  letter-spacing: 0.3px;
  box-shadow: 0 4px 14px rgba(204,20,22,0.35);
  font-family: inherit;
}
.login-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(204,20,22,0.45); }
.login-btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.login-footer {
  text-align: center;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid #f0f0f0;
  font-size: 0.75rem;
  color: #aaa;
}

#loginAlert {
  display: none;
  padding: 11px 14px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 0.84rem;
  font-weight: 600;
  background: #fff0f0;
  color: #CC1416;
  border: 1px solid #fecaca;
}

/* ── Print ── */
@media print {
  .sidebar, .header, .action-bar, .btn, .btn-close-modal, .modal-footer, .page-watermark {
    display: none !important;
  }
  .main-wrapper { margin-left: 0 !important; }
  .content-body { padding: 0 !important; }
  .card { border: none !important; box-shadow: none !important; }
  body { background: #fff !important; }
  .payslip-sheet { border: none !important; padding: 0 !important; }
}

/* (Unified responsive rules consolidated at end of stylesheet — VIP Mobile System) */

/* ---------------------------------------
   MONTHLY ATTENDANCE MATRIX
--------------------------------------- */
#matrixTable thead th {
    position: sticky;
    top: 0;
    z-index: 3;
    background: #f8fafc;
    font-size: 0.75rem;
    padding: 6px 4px;
    text-align: center;
    white-space: nowrap;
}
#matrixTable td {
    padding: 5px 4px;
    text-align: center;
    font-size: 0.75rem;
    border-bottom: 1px solid #f1f5f9;
}
#matrixTable thead th:first-child,
#matrixTable tbody td:first-child {
    position: sticky;
    left: 0;
    z-index: 2;
    background: #fff;
    text-align: left;
    padding-left: 12px;
    min-width: 150px;
    border-right: 2px solid #e2e8f0;
}
#matrixTable thead th:first-child {
    z-index: 4;
    background: #f8fafc;
}

/* ---------------------------------------
   SAVINGS & INCOME BADGES
--------------------------------------- */
.badge-blue {
    background: #dbeafe;
    color: #1d4ed8;
}
.income-status-paid { color: #16a34a; font-weight: 700; }
.income-status-overdue { color: #dc2626; font-weight: 700; }
.income-status-partial { color: #2563eb; font-weight: 700; }
.income-status-unpaid { color: #d97706; font-weight: 700; }

/* Modal max-width override for wide modals */
.modal-box[style*="1100px"] {
    max-height: 90vh;
    overflow-y: auto;
}

/* doc-upload-zone */
.doc-upload-zone {
    border: 2px dashed #cbd5e1;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    background: #f8fafc;
}
.doc-upload-zone:hover {
    border-color: var(--accent, #cc1416);
    background: #fff5f5;
}


/* ==========================================================================
   MODULE 1: ATTENDANCE MANAGEMENT STYLES
   ========================================================================== */

.att-subtabs {
    display: flex;
    gap: 8px;
    margin-bottom: 18px;
    border-bottom: 2px solid var(--border);
    padding-bottom: 10px;
    flex-wrap: wrap;
}

.att-subtab-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 18px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: #fff;
    color: var(--text-muted);
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.18s ease;
}

.att-subtab-btn:hover {
    background: #f8fafc;
    color: var(--text-main);
    border-color: #cbd5e1;
}

.att-subtab-btn.active {
    background: linear-gradient(135deg, #CC1416, #991b1b);
    color: #fff;
    border-color: #CC1416;
    box-shadow: 0 2px 8px rgba(204, 20, 22, 0.24);
}

.att-tab-panel {
    display: none;
}

.att-tab-panel.active {
    display: block;
}

/* Circular 4-Option Color-Coded Attendance Controls (P / A / L / H) */
.att-circle-group {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.att-circle-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 2px solid #cbd5e1;
    background: #ffffff;
    color: #475569;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.16s ease;
    padding: 0;
    line-height: 1;
}

.att-circle-btn:hover {
    transform: scale(1.08);
}

.att-btn-present {
    border-color: #86efac;
    color: #16a34a;
}
.att-btn-present:hover,
.att-btn-present.selected {
    background: #16a34a;
    border-color: #15803d;
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(22, 163, 74, 0.35);
}

.att-btn-absent {
    border-color: #fca5a5;
    color: #dc2626;
}
.att-btn-absent:hover,
.att-btn-absent.selected {
    background: #dc2626;
    border-color: #b91c1c;
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(220, 38, 38, 0.35);
}

.att-btn-leave {
    border-color: #fdba74;
    color: #ea580c;
}
.att-btn-leave:hover,
.att-btn-leave.selected {
    background: #ea580c;
    border-color: #c2410c;
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(234, 88, 12, 0.35);
}

.att-btn-holiday {
    border-color: #93c5fd;
    color: #2563eb;
}
.att-btn-holiday:hover,
.att-btn-holiday.selected {
    background: #2563eb;
    border-color: #1d4ed8;
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.35);
}

/* Joining Date Rule — Automatic NJ (Not Joined) */
.att-row-nj {
    background: #f8fafc !important;
    opacity: 0.78;
}

.att-nj-pill {
    display: inline-flex;
    align-items: center;
    padding: 5px 12px;
    border-radius: 999px;
    background: #e2e8f0;
    color: #475569;
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    user-select: none;
    cursor: not-allowed;
}

.att-saved-dot,
.att-unsaved-dot {
    display: inline-block;
    margin-left: 8px;
    padding: 1px 7px;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 600;
    vertical-align: middle;
}

.att-saved-dot {
    background: #dcfce7;
    color: #166534;
}

.att-unsaved-dot {
    background: #fef3c7;
    color: #92400e;
}

/* Legend Bar */
.att-legend-bar {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 500;
}

.att-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 5px;
    vertical-align: middle;
}
.att-dot-p  { background: #16a34a; }
.att-dot-a  { background: #dc2626; }
.att-dot-l  { background: #ea580c; }
.att-dot-h  { background: #2563eb; }
.att-dot-nj { background: #94a3b8; }

/* Excel-Style Monthly Attendance Register (Horizontally Scrollable + Sticky ID & Name) */
.att-register-wrap {
    width: 100%;
    overflow-x: auto;
    overflow-y: auto;
    max-height: 68vh;
    position: relative;
}

.att-register-table {
    width: max-content;
    min-width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.8rem;
}

.att-register-table thead th {
    position: sticky;
    top: 0;
    z-index: 3;
    background: #1e293b;
    color: #ffffff;
    font-weight: 700;
    text-align: center;
    padding: 10px 6px;
    border-right: 1px solid #334155;
    border-bottom: 2px solid #0f172a;
    white-space: nowrap;
}

.att-register-table tbody td {
    padding: 7px 5px;
    border-right: 1px solid #e2e8f0;
    border-bottom: 1px solid #e2e8f0;
    background: #ffffff;
    white-space: nowrap;
}

.att-register-table tbody tr:nth-child(even) td {
    background: #f8fafc;
}

.att-register-table .att-sticky-col {
    position: sticky;
    z-index: 2;
}

.att-register-table thead .att-sticky-col {
    z-index: 5;
}

.att-register-table .att-sticky-id {
    left: 0;
    width: 90px;
    min-width: 90px;
    max-width: 90px;
    text-align: center;
}

.att-register-table .att-sticky-name {
    left: 90px;
    width: 195px;
    min-width: 195px;
    max-width: 195px;
    text-align: left;
    padding-left: 10px;
    padding-right: 10px;
    overflow: hidden;
    text-overflow: ellipsis;
    box-shadow: 3px 0 6px -2px rgba(15, 23, 42, 0.12);
}

.att-register-table .att-day-col {
    width: 34px;
    min-width: 34px;
}

.att-register-table .att-day-cell {
    text-align: center;
    padding: 5px 2px;
}

.att-register-table .att-present-total-col {
    background: #166534 !important;
    color: #ffffff;
    min-width: 98px;
    padding: 10px 10px;
    border-left: 2px solid #0f172a;
}

.att-register-table .att-present-total-cell {
    text-align: center;
    font-weight: 800;
    font-size: 0.88rem;
    color: #166534;
    background: #f0fdf4 !important;
    border-left: 2px solid #cbd5e1;
}

.att-cell-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 22px;
    padding: 0 4px;
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 700;
}

.att-cell-empty {
    color: #cbd5e1;
    font-weight: 600;
}

.att-status-pill {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.76rem;
    font-weight: 700;
}

.att-st-present { background: #dcfce7; color: #166534; }
.att-st-absent  { background: #fee2e2; color: #991b1b; }
.att-st-leave   { background: #ffedd5; color: #9a3412; }
.att-st-holiday { background: #dbeafe; color: #1e40af; }
.att-st-nj      { background: #e2e8f0; color: #475569; }

.att-pagination-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 18px;
    border-top: 1px solid var(--border);
    background: #f8fafc;
    flex-wrap: wrap;
    gap: 10px;
}


/* ==========================================================================
   MODULE 2: DOCUMENT MANAGEMENT STYLES
   ========================================================================== */

.doc-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 14px;
}

.doc-summary-card {
    cursor: pointer;
    border: 2px solid transparent;
    transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.doc-summary-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
    border-color: #cbd5e1;
}

.doc-summary-card.active-card {
    border-color: var(--accent, #CC1416);
    background: #fffafa;
    box-shadow: 0 4px 14px rgba(204, 20, 22, 0.14);
}

.doc-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.doc-filter-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: #ffffff;
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.doc-filter-pill:hover {
    background: #f8fafc;
    border-color: #94a3b8;
    color: var(--text-main);
}

.doc-filter-pill.active {
    background: #1a1a1a;
    color: #ffffff;
    border-color: #1a1a1a;
}

.doc-pill-cnt {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: #e2e8f0;
    color: #334155;
    font-size: 0.7rem;
    font-weight: 700;
}

.doc-filter-pill.active .doc-pill-cnt {
    background: #CC1416;
    color: #ffffff;
}

.doc-emp-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, #CC1416, #8B0000);
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    flex-shrink: 0;
}

.doc-file-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 220px;
}

.doc-ext-tag {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 4px;
    background: #fee2e2;
    color: #991b1b;
    font-size: 0.68rem;
    font-weight: 800;
    flex-shrink: 0;
}

.doc-file-name {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-main);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.doc-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    white-space: nowrap;
}

.doc-badge-valid    { background: #dcfce7; color: #166534; }
.doc-badge-expiring { background: #fef3c7; color: #92400e; }
.doc-badge-expired  { background: #fee2e2; color: #991b1b; }
.doc-badge-info     { background: #dbeafe; color: #1e40af; }
.doc-badge-unset    { background: #f1f5f9; color: #64748b; }

.doc-actions-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 5px;
    flex-wrap: wrap;
}

.doc-history-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.doc-history-item {
    border: 1px solid var(--border);
    border-left: 4px solid #CC1416;
    border-radius: 8px;
    padding: 12px 14px;
    background: #f8fafc;
}

.doc-history-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.doc-history-details {
    font-size: 0.82rem;
    color: var(--text-main);
    display: flex;
    flex-direction: column;
    gap: 4px;
}


/* Enhanced Upload Status & Missing Document UX */
.doc-filter-divider {
    width: 1px;
    height: 24px;
    background: #cbd5e1;
    align-self: center;
    margin: 0 2px;
}

.doc-filter-pill.pill-uploaded {
    border-color: #86efac;
    color: #166534;
    background: #f0fdf4;
}
.doc-filter-pill.pill-uploaded.active {
    background: #16a34a;
    border-color: #15803d;
    color: #ffffff;
}
.doc-filter-pill.pill-uploaded.active .doc-pill-cnt {
    background: rgba(255, 255, 255, 0.25);
    color: #ffffff;
}

.doc-filter-pill.pill-missing {
    border-color: #fca5a5;
    color: #991b1b;
    background: #fef2f2;
}
.doc-filter-pill.pill-missing.active {
    background: #dc2626;
    border-color: #b91c1c;
    color: #ffffff;
}
.doc-filter-pill.pill-missing.active .doc-pill-cnt {
    background: rgba(255, 255, 255, 0.25);
    color: #ffffff;
}

.doc-pending-banner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    padding: 12px 16px;
    margin-bottom: 16px;
    border-radius: 10px;
    border: 1px solid #fecaca;
    background: linear-gradient(90deg, #fff5f5, #fffbeb);
    color: #7f1d1d;
    font-size: 0.86rem;
}

.doc-banner-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #dc2626;
    display: inline-block;
    flex-shrink: 0;
}

.doc-row-missing td {
    background: #fffbeb !important;
}

.doc-upload-state-ok {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 2px 8px;
    border-radius: 999px;
    background: #dcfce7;
    color: #166534;
    font-size: 0.72rem;
    font-weight: 700;
}

.doc-upload-state-missing {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 2px 8px;
    border-radius: 999px;
    background: #fee2e2;
    color: #991b1b;
    font-size: 0.72rem;
    font-weight: 700;
}


/* ==========================================================================
   MODULE 3: ADVANCE MANAGEMENT STYLES
   ========================================================================== */

.adv-summary-card {
    cursor: pointer;
    border: 2px solid transparent;
    transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.adv-summary-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
    border-color: #cbd5e1;
}

.adv-summary-card.active-card {
    border-color: var(--accent, #CC1416);
    background: #fffafa;
}

.adv-tab-panel {
    display: none;
}

.adv-tab-panel.active {
    display: block;
}

.adv-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.74rem;
    font-weight: 700;
    white-space: nowrap;
}

.adv-badge-pending {
    background: #fef3c7;
    color: #92400e;
}

.adv-badge-deducted {
    background: #dcfce7;
    color: #166534;
}

.adv-ref-chip {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 5px;
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    color: #334155;
    font-size: 0.76rem;
    font-weight: 600;
}

.adv-hist-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.adv-hist-card {
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px 14px;
    background: #f8fafc;
}

.adv-hist-lbl {
    font-size: 0.76rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.adv-hist-val {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text-main);
}

.dash-adv-tab {
    padding: 4px 10px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: #ffffff;
    color: var(--text-muted);
    font-size: 0.76rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.dash-adv-tab.active {
    background: #1a1a1a;
    color: #ffffff;
    border-color: #1a1a1a;
}


/* Module 3: Monthly/Yearly Excel-Style Advance Sheet */
.adv-prev-tag {
    display: inline-block;
    padding: 2px 7px;
    border-radius: 999px;
    background: #fee2e2;
    color: #991b1b;
    font-size: 0.68rem;
    font-weight: 700;
    margin-left: 4px;
}

.adv-sheet-table .adv-month-col {
    min-width: 78px;
}

.adv-sheet-table .adv-month-hl {
    background: #CC1416 !important;
}

.adv-sheet-table .adv-sum-col {
    min-width: 96px;
}

.adv-sheet-cell {
    text-align: right;
    padding: 7px 8px !important;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: filter 0.12s ease;
}

.adv-sheet-cell:hover {
    filter: brightness(0.95);
}

.adv-cell-pending {
    background: #fef3c7 !important;
    color: #92400e !important;
    font-weight: 700;
}

.adv-cell-deducted {
    background: #dcfce7 !important;
    color: #166534 !important;
    font-weight: 700;
}

.adv-month-hl-cell {
    outline: 2px solid rgba(204, 20, 22, 0.35);
    outline-offset: -2px;
}

.adv-sheet-total {
    text-align: right;
    padding: 7px 9px !important;
    font-weight: 700;
    background: #f1f5f9 !important;
    color: #0f172a;
}

.adv-sheet-ded {
    text-align: right;
    padding: 7px 9px !important;
    font-weight: 700;
    background: #f0fdf4 !important;
    color: #166534;
}

.adv-sheet-pend {
    text-align: right;
    padding: 7px 9px !important;
    font-weight: 700;
    color: #64748b;
}

.adv-sheet-pend.has-pend {
    background: #fef2f2 !important;
    color: #dc2626;
}

.adv-sheet-foot-row td {
    position: sticky;
    bottom: 0;
    z-index: 4;
    background: #1e293b !important;
    color: #ffffff !important;
    font-weight: 700;
    padding: 9px 8px !important;
    border-top: 2px solid #0f172a;
}

.adv-sheet-foot-row .att-sticky-col {
    z-index: 6;
    background: #0f172a !important;
}

.adv-sheet-foot-num {
    text-align: right;
    font-size: 0.78rem;
}


/* ═══════════════════════════════════════════════════════════════════════════
   MODULE 4 — EMPLOYEE SAVING / PF SAVING STYLES
   ═══════════════════════════════════════════════════════════════════════════ */

.sav-tabs-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.adv-subtabs {
    display: inline-flex;
    gap: 6px;
    background: #f1f5f9;
    padding: 4px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
}

.adv-subtab-btn {
    padding: 7px 14px;
    border: none;
    background: transparent;
    color: #475569;
    font-size: 0.84rem;
    font-weight: 600;
    border-radius: 7px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.adv-subtab-btn:hover {
    color: #0f172a;
    background: rgba(255, 255, 255, 0.65);
}

.adv-subtab-btn.active {
    background: #ffffff;
    color: var(--primary);
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.1);
}

.sav-liability-banner {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    border-left: 4px solid #059669;
    color: #065f46;
    font-size: 0.82rem;
    line-height: 1.45;
    padding: 9px 14px;
    border-radius: 8px;
    margin-bottom: 14px;
}

.adv-sheet-scroll {
    width: 100%;
    overflow-x: auto;
    overflow-y: auto;
    max-height: 66vh;
    position: relative;
}

.adv-sheet-table {
    width: max-content;
    min-width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.8rem;
}

.adv-sheet-table thead th {
    position: sticky;
    top: 0;
    z-index: 3;
    background: #1e293b;
    color: #ffffff;
    font-weight: 700;
    padding: 10px 8px;
    border-right: 1px solid #334155;
    border-bottom: 2px solid #0f172a;
    white-space: nowrap;
}

.adv-sheet-table tbody td,
.adv-sheet-table tfoot td {
    padding: 7px 8px;
    border-right: 1px solid #e2e8f0;
    border-bottom: 1px solid #e2e8f0;
    background: #ffffff;
    white-space: nowrap;
}

.adv-sheet-table tbody tr:nth-child(even) td {
    background: #f8fafc;
}

.adv-sticky-col1 {
    position: sticky;
    left: 0;
    z-index: 2;
    min-width: 92px;
    width: 92px;
    background: #ffffff;
}

.adv-sticky-col2 {
    position: sticky;
    left: 92px;
    z-index: 2;
    min-width: 185px;
    width: 185px;
    background: #ffffff;
    box-shadow: 2px 0 6px rgba(15, 23, 42, 0.06);
}

.adv-sheet-table thead .adv-sticky-col1,
.adv-sheet-table thead .adv-sticky-col2 {
    z-index: 5;
    background: #0f172a;
}

.sav-sheet-num {
    text-align: right;
    font-variant-numeric: tabular-nums;
    min-width: 78px;
}

.sav-cell-zero {
    color: #cbd5e1;
    cursor: pointer;
}

.sav-cell-pos {
    color: #065f46;
    background: #f0fdf4 !important;
    font-weight: 700;
    cursor: pointer;
}

.sav-cell-neg {
    color: #dc2626;
    background: #fef2f2 !important;
    font-weight: 700;
    cursor: pointer;
}

.sav-cell-flat {
    color: #b45309;
    background: #fffbeb !important;
    font-weight: 600;
    cursor: pointer;
}

.sav-cell-pos:hover,
.sav-cell-neg:hover,
.sav-cell-flat:hover,
.sav-cell-zero:hover {
    outline: 1.5px solid var(--primary);
    outline-offset: -1px;
}


/* ═══════════════════════════════════════════════════════════════════════════
   MODULE 5 — PAYROLL MANAGEMENT & VIP SALARY SLIP STYLES
   ═══════════════════════════════════════════════════════════════════════════ */

.payroll-stats-6 {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 12px;
}

.payroll-stats-6 .stat-card {
    padding: 14px 14px;
}

.payroll-stats-6 .stat-details .label {
    font-size: 0.74rem;
}

.payroll-stats-6 .stat-details .value {
    font-size: 1.05rem;
}

@media (max-width: 1360px) {
    .payroll-stats-6 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .payroll-stats-6 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.vip-slip-wrap {
    position: relative;
    overflow: hidden;
}

.vip-slip-watermark {
    position: absolute;
    top: 52%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-18deg);
    font-size: 9.5rem;
    font-weight: 900;
    font-family: 'Arial Black', Arial, sans-serif;
    color: rgba(15, 23, 42, 0.035);
    pointer-events: none;
    user-select: none;
    z-index: 0;
}

.vip-slip-wrap > *:not(.vip-slip-watermark) {
    position: relative;
    z-index: 1;
}


/* ==========================================================================
   MODULE 6A: INCOME / PAYMENT MANAGEMENT STYLES
   ========================================================================== */

.inc-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.inc-summary-card {
    cursor: pointer;
    border: 2px solid transparent;
    transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.inc-summary-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
    border-color: #cbd5e1;
}

.inc-summary-card.active-card {
    border-color: var(--accent, #CC1416);
    background: #fffafa;
}

.inc-tabs-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 10px;
}

.inc-tabs {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.inc-tab-btn {
    padding: 8px 15px;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #334155;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.inc-tab-btn:hover {
    background: #f1f5f9;
}

.inc-tab-btn.active {
    background: #0f172a;
    color: #ffffff;
    border-color: #0f172a;
}

.inc-subpill {
    padding: 7px 14px;
    border-radius: 999px;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #334155;
    font-weight: 600;
    font-size: 0.83rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.inc-subpill.active {
    background: #1e3a8a;
    color: #ffffff;
    border-color: #1e3a8a;
}

.inc-banner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    padding: 12px 16px;
    margin-bottom: 14px;
    border-radius: 10px;
    border: 1px solid #fecaca;
    background: linear-gradient(90deg, #fff5f5, #fffbeb);
    color: #1e293b;
    font-size: 0.86rem;
}

.inc-hist-kpi-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
    gap: 10px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #e2e8f0;
}

.inc-hist-kpi-strip > div {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.inc-hist-kpi-strip span {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-muted);
    font-weight: 600;
}

.inc-hist-kpi-strip strong {
    font-size: 0.92rem;
}


/* ═══════════════════════════════════════════════════════════════════════════
   MODULE 6B — EXPENSE MANAGEMENT & MONTHLY BUDGET TRACKER
   ═══════════════════════════════════════════════════════════════════════════ */

.exp-budget-hero {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 14px;
    margin-bottom: 16px;
}

.exp-budget-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px 18px;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

.exp-budget-card.over-budget {
    border-color: #fca5a5;
    background: #fff5f5;
}

.exp-budget-lbl {
    font-size: 0.76rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.exp-budget-val {
    font-size: 1.32rem;
    font-weight: 800;
    color: #0f172a;
}

.exp-budget-sub {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.exp-progress-track {
    width: 100%;
    height: 9px;
    border-radius: 999px;
    background: #e2e8f0;
    overflow: hidden;
    margin-top: 8px;
}

.exp-progress-fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #16a34a, #22c55e);
    transition: width 0.25s ease;
}

.exp-progress-fill.warn {
    background: linear-gradient(90deg, #d97706, #f59e0b);
}

.exp-progress-fill.over {
    background: linear-gradient(90deg, #b91c1c, #ef4444);
}

.exp-account-pill {
    display: inline-flex;
    align-items: center;
    padding: 2px 9px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.exp-account-cash {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
}

.exp-account-bank {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

.exp-receipt-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px;
    border-radius: 6px;
    font-size: 0.74rem;
    font-weight: 600;
    background: #f1f5f9;
    color: #0f172a;
    border: 1px solid #cbd5e1;
    cursor: pointer;
    transition: all 0.15s ease;
}

.exp-receipt-chip:hover {
    background: #e2e8f0;
    border-color: #94a3b8;
}

.exp-info-note {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    padding: 11px 16px;
    border-radius: 10px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1e3a8a;
    font-size: 0.83rem;
    margin-bottom: 14px;
}


/* ═══════════════════════════════════════════════════════════════════════════
   MODULE 6F — FINANCIAL OVERVIEW DASHBOARD
   ═══════════════════════════════════════════════════════════════════════════ */

.fd-preset-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 12px 16px;
    margin-bottom: 18px;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

.fd-preset-pills {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    align-items: center;
}

.fd-preset-btn {
    padding: 6px 13px;
    border-radius: 999px;
    border: 1px solid #cbd5e1;
    background: #f8fafc;
    color: #334155;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.fd-preset-btn:hover {
    background: #e2e8f0;
}

.fd-preset-btn.active {
    background: #CC1416;
    color: #ffffff;
    border-color: #CC1416;
}

.fd-section-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 18px 0 10px;
    font-size: 0.82rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #475569;
}

.fd-two-col {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 18px;
    margin-bottom: 18px;
}

.fd-chart-wrap {
    display: flex;
    align-items: flex-end;
    justify-content: space-around;
    gap: 10px;
    height: 210px;
    padding: 18px 12px 10px;
    border-bottom: 1px solid #e2e8f0;
}

.fd-chart-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    height: 100%;
    justify-content: flex-end;
}

.fd-bar-pair {
    display: flex;
    align-items: flex-end;
    gap: 5px;
    height: 155px;
    width: 100%;
    justify-content: center;
}

.fd-bar {
    width: 18px;
    min-height: 3px;
    border-radius: 5px 5px 0 0;
    transition: height 0.25s ease;
}

.fd-bar-in {
    background: linear-gradient(180deg, #22c55e, #15803d);
}

.fd-bar-out {
    background: linear-gradient(180deg, #ef4444, #b91c1c);
}

.fd-chart-lbl {
    margin-top: 8px;
    font-size: 0.75rem;
    font-weight: 700;
    color: #475569;
}

.fd-cat-row {
    margin-bottom: 12px;
}

.fd-cat-top {
    display: flex;
    justify-content: space-between;
    font-size: 0.83rem;
    margin-bottom: 4px;
}


/* Module 7 — 9-Section Employee Profile Tabs */
.prof-sec-tab {
    padding: 5px 10px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.76rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.prof-sec-tab:hover {
    background: rgba(255, 255, 255, 0.18);
    color: #ffffff;
}

.prof-sec-tab.active {
    background: #CC1416;
    border-color: #CC1416;
    color: #ffffff;
}


/* ═══════════════════════════════════════════════════════════════════════════
   MODULE 8 — HEADER NOTIFICATION BELL & AUDIT CENTER
   ═══════════════════════════════════════════════════════════════════════════ */

.notif-bell-wrap {
    position: relative;
}

.notif-bell-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    color: #1e293b;
    cursor: pointer;
    transition: all 0.15s ease;
}

.notif-bell-btn:hover {
    background: #fff0f0;
    border-color: #fecaca;
    color: #CC1416;
}

.notif-bell-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    min-width: 19px;
    height: 19px;
    padding: 0 5px;
    border-radius: 999px;
    background: #CC1416;
    color: #ffffff;
    font-size: 0.68rem;
    font-weight: 800;
    display: none;
    align-items: center;
    justify-content: center;
    border: 2px solid #ffffff;
}

.notif-dropdown {
    position: absolute;
    top: 46px;
    right: 0;
    width: 370px;
    max-width: 92vw;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.16);
    z-index: 1200;
    overflow: hidden;
    display: none;
}

.notif-drop-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    background: #0f172a;
    color: #ffffff;
    font-size: 0.85rem;
    font-weight: 700;
}

.notif-drop-list {
    max-height: 360px;
    overflow-y: auto;
}

.notif-drop-item {
    padding: 11px 14px;
    border-bottom: 1px solid #f1f5f9;
    cursor: pointer;
    transition: background 0.15s ease;
}

.notif-drop-item:hover {
    background: #f8fafc;
}

.notif-drop-item.unread {
    background: #fff5f5;
    border-left: 3px solid #CC1416;
}

.notif-drop-footer {
    padding: 10px 14px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}


/* ═══════════════════════════════════════════════════════════════════════════
   MODULE 9 — EXECUTIVE VIP POLISH & FULL RESPONSIVE SYSTEM
   Desktop · Laptop · Tablet (<=1024px) · Mobile (<=768px / <=520px) · Print
   ═══════════════════════════════════════════════════════════════════════════ */

/* 1. Tabular numerals & crisp alignment for all executive financial figures */
.data-table td,
.stat-details .value,
.exp-budget-val,
.inc-hist-kpi-strip strong,
.fd-cat-top strong {
    font-variant-numeric: tabular-nums;
}

/* 2. Refined executive scrollbars */
::-webkit-scrollbar {
    width: 7px;
    height: 7px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}
.sidebar-menu::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.16);
}
.sidebar-menu::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.28);
}

/* 3. Subtle VIP elevation & visual hierarchy */
.card {
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.045);
    transition: box-shadow 0.2s ease;
}
.card:hover {
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.07);
}
.stat-card {
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.045);
}
.table-responsive {
    -webkit-overflow-scrolling: touch;
}
.menu-title {
    color: #6b7280;
}

/* 4. Header left group & Mobile Menu Hamburger Button */
.header-left-group {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}
.header-title {
    min-width: 0;
}
.header-title h1 {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.header-title p {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mobile-menu-btn {
    display: none;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: #ffffff;
    color: var(--text-main);
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.15s ease;
}
.mobile-menu-btn:hover {
    background: #fff0f0;
    border-color: #fecaca;
    color: #CC1416;
}

/* 5. Mobile/Tablet Sidebar Backdrop Overlay */
.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 14, 24, 0.56);
    backdrop-filter: blur(2px);
    z-index: 95;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s ease;
}
.sidebar-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

/* 6. Dashboard responsive 2-column grid & universal grid/flex min-width containment */
.dash-two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    align-items: start;
}
.dash-two-col > *,
.fd-two-col > *,
.stats-row > *,
.inc-summary-grid > *,
.doc-summary-grid > *,
.exp-budget-hero > *,
.card-header,
.card-body,
.stat-card,
.stat-details {
    min-width: 0;
    max-width: 100%;
}

/* Touch-friendly tap feel without accidental UI label selection or 300ms delay */
.btn,
.menu-item,
.inc-tab-btn,
.att-subtab-btn,
.adv-subtab-btn,
.fd-preset-btn,
.doc-filter-pill,
.prof-sec-tab,
.inc-subpill,
.dash-adv-tab,
.date-mode-btn,
.mobile-menu-btn,
.notif-bell-btn,
.mob-nav-item,
.header-profile-btn,
.sidebar-close-btn {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    user-select: none;
}

/* Mobile Sidebar Close Button (hidden on desktop) */
.sidebar-close-btn {
    display: none;
    margin-left: auto;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    font-size: 1.45rem;
    line-height: 1;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.15s ease;
}
.sidebar-close-btn:hover {
    background: rgba(204, 20, 22, 0.35);
}

/* Mobile Executive Bottom Navigation Bar (hidden on desktop) */
.mobile-bottom-nav {
    display: none;
}

/* ── Round 1: Clean Labeled Date Range Controls & Mode Toggle ── */
.date-range-group {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.date-range-field {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0 8px 0 10px;
    height: 36px;
}
.date-range-field:focus-within {
    border-color: #CC1416;
    box-shadow: 0 0 0 3px rgba(204,20,22,0.12);
}
.date-range-field label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    user-select: none;
    white-space: nowrap;
}
.date-range-field input[type="date"] {
    border: none !important;
    box-shadow: none !important;
    padding: 4px 2px !important;
    background: transparent !important;
    font-size: 0.83rem;
    height: 32px;
    width: 130px;
}
.date-mode-toggle {
    display: inline-flex;
    background: #f1f5f9;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 2px;
    gap: 2px;
}
.date-mode-btn {
    padding: 5px 10px;
    border: none;
    background: transparent;
    color: #475569;
    font-size: 0.78rem;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
}
.date-mode-btn.active {
    background: #0f172a;
    color: #ffffff;
}

/* ── Searchable Employee Picker (Universal Combobox) ── */
.esp-wrap {
    position: relative;
    width: 100%;
}
.esp-wrap.esp-filter-mode {
    width: auto;
    min-width: 210px;
}
.esp-native-select {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    opacity: 0 !important;
    pointer-events: none !important;
    overflow: hidden !important;
}
.esp-input-row {
    position: relative;
    display: flex;
    align-items: center;
}
.esp-search-input {
    width: 100%;
    padding-right: 30px !important;
}
.esp-clear-btn {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 22px;
    height: 22px;
    border: none;
    border-radius: 50%;
    background: #e2e8f0;
    color: #475569;
    font-size: 0.95rem;
    line-height: 1;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
.esp-clear-btn:hover {
    background: #fecaca;
    color: #b91c1c;
}
.esp-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    min-width: 240px;
    max-height: 240px;
    overflow-y: auto;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.16);
    z-index: 1400;
}
.esp-item {
    padding: 9px 12px;
    font-size: 0.84rem;
    color: #0f172a;
    cursor: pointer;
    border-bottom: 1px solid #f1f5f9;
}
.esp-item:last-child { border-bottom: none; }
.esp-item:hover,
.esp-item.highlighted {
    background: #fff5f5;
    color: #CC1416;
}
.esp-item.selected {
    background: #eff6ff;
    font-weight: 700;
    color: #1e3a8a;
}
.esp-empty {
    padding: 12px;
    text-align: center;
    font-size: 0.82rem;
    color: var(--text-muted);
}

/* ── Monthly Register Working Hours Sub-Tag & Total Hours Column ── */
.att-cell-hrs {
    display: block;
    font-size: 0.63rem;
    font-weight: 700;
    color: #0f172a;
    margin-top: 2px;
    line-height: 1;
}
.att-hours-total-col {
    background: #1e3a8a !important;
    color: #ffffff !important;
    text-align: center;
    white-space: nowrap;
    min-width: 74px;
}
.att-hours-total-cell {
    background: #eff6ff !important;
    color: #1e3a8a !important;
    font-weight: 800;
    text-align: center;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}
.att-locked-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
}


/* ===========================================================================
   VIP EXECUTIVE RESPONSIVE SYSTEM (v23)
   Hard Viewport Lock + Dedicated Scrollable Toolbars/Navbars + Mobile Bottom Bar
   Laptop (<=1240px) · Tablet (<=1024px) · Mobile (<=768px) · Small Phone (<=520px)
   =========================================================================== */

/* 1. Laptop / Small Desktop (<= 1240px) */
@media (max-width: 1240px) {
    .header-brand-pill span {
        display: none;
    }
    .header {
        padding: 0 20px;
    }
    .content-body {
        padding: 20px 22px;
    }
    .fd-two-col {
        grid-template-columns: 1fr;
    }
}

/* 2. Tablet & Drawer Breakpoint (<= 1024px) */
@media (max-width: 1024px) {
    .mobile-menu-btn {
        display: inline-flex;
    }
    .sidebar-close-btn {
        display: inline-flex;
    }
    .sidebar {
        width: min(285px, 84vw);
        transform: translate3d(-100%, 0, 0);
        will-change: transform;
        z-index: 120;
        box-shadow: none;
    }
    .sidebar.open,
    .sidebar.mobile-open {
        transform: translate3d(0, 0, 0);
        box-shadow: 10px 0 32px rgba(0, 0, 0, 0.38);
    }
    .sidebar-overlay {
        z-index: 115;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        background: rgba(15, 23, 42, 0.54);
    }
    .modal-backdrop {
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        background: rgba(15, 23, 42, 0.56);
    }
    .main-wrapper {
        margin-left: 0;
        width: 100%;
        min-width: 0;
        max-width: 100%;
    }
    .page-watermark {
        left: 50%;
        width: 300px;
        max-width: 75vw;
    }
    .dash-two-col {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    .stats-row,
    .exp-budget-hero {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* 3. Mobile VIP Professional Experience (<= 768px) — 60fps Butter-Smooth + Zero Cut-Off */
@media (max-width: 768px) {
    /* Eliminate fixed SVG & blur GPU repaint lag on iOS Safari & Android Chrome */
    .page-watermark {
        display: none !important;
    }
    .view-section.active {
        animation: none;
    }
    .card,
    .stat-card {
        transition: none;
    }

    /* ── Sticky Top App Header (Crisp Solid Surface = Instant 60fps Scroll) ── */
    .header {
        height: auto;
        min-height: 56px;
        padding: calc(8px + env(safe-area-inset-top, 0px)) 12px 8px;
        gap: 10px;
        width: 100%;
        max-width: 100%;
        background: #ffffff;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        border-bottom: 1px solid var(--border);
        box-shadow: 0 1px 6px rgba(15, 23, 42, 0.06);
    }
    .header-left-group {
        flex: 1;
        min-width: 0;
        gap: 10px;
    }
    .mobile-menu-btn {
        width: 38px;
        height: 38px;
        border-radius: 10px;
    }
    .header-title {
        flex: 1;
        min-width: 0;
    }
    .header-title h1 {
        font-size: 1.02rem;
        letter-spacing: -0.01em;
    }
    .header-title p {
        display: none;
    }
    .header-brand-pill {
        display: none !important;
    }
    .header-right {
        gap: 8px;
        flex-shrink: 0;
    }
    .header-date-badge {
        padding: 5px 9px;
        font-size: 0.7rem;
        max-width: 120px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .notif-bell-btn {
        width: 38px;
        height: 38px;
    }
    .notif-dropdown {
        position: fixed;
        top: calc(62px + env(safe-area-inset-top, 0px));
        left: 10px;
        right: 10px;
        width: auto;
        max-width: none;
    }

    /* ── Main Content Safe Area (leaves room for Bottom Nav Bar) ── */
    .content-body {
        padding: 12px 12px calc(86px + env(safe-area-inset-bottom, 0px));
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }

    /* ── VIP Bottom Quick-Navigation Bar (Solid GPU-Friendly Layer) ── */
    .mobile-bottom-nav {
        display: flex;
        align-items: stretch;
        justify-content: space-around;
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 98;
        background: #ffffff;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        border-top: 1px solid #e2e8f0;
        box-shadow: 0 -4px 18px rgba(15, 23, 42, 0.08);
        padding: 5px 4px calc(6px + env(safe-area-inset-bottom, 0px));
        width: 100%;
        max-width: 100%;
        transform: translate3d(0, 0, 0);
    }
    .mob-nav-item {
        flex: 1 1 0;
        min-width: 0;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        padding: 5px 2px;
        border: none;
        background: transparent;
        color: #64748b;
        font-family: inherit;
        font-size: 0.66rem;
        font-weight: 600;
        cursor: pointer;
        border-radius: 10px;
        position: relative;
        transition: color 0.14s ease, background 0.14s ease;
    }
    .mob-nav-item svg {
        width: 20px;
        height: 20px;
        flex-shrink: 0;
    }
    .mob-nav-item span {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 100%;
    }
    .mob-nav-item.active {
        color: #CC1416;
        background: #fff1f2;
        font-weight: 700;
    }
    .mob-nav-item.active::before {
        content: '';
        position: absolute;
        top: -5px;
        left: 24%;
        right: 24%;
        height: 2.5px;
        border-radius: 999px;
        background: linear-gradient(90deg, #CC1416, #C9A84C);
    }

    /* ── Toast Positioned Cleanly Above Mobile Bottom Nav ── */
    .toast-box {
        left: 12px;
        right: 12px;
        bottom: calc(74px + env(safe-area-inset-bottom, 0px));
    }
    .toast-msg {
        width: 100%;
        justify-content: center;
        text-align: center;
    }

    /* ── Clean Native-Style Sub-Tabs & Zero Cut-Off Wrapping Action Toolbars ── */
    .inc-tabs-bar,
    .sav-tabs-bar,
    .att-subtabs.adv-tabs-bar {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 8px !important;
        margin-bottom: 12px !important;
        padding-bottom: 8px;
    }
    .inc-tabs-bar > .btn {
        align-self: stretch;
    }
    #view-dashboard .inc-tabs-bar {
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        align-items: center !important;
        justify-content: space-between;
        gap: 6px !important;
    }
    #view-dashboard .inc-tabs-bar .inc-tabs {
        width: auto;
        flex: 1 1 auto;
        min-width: 0;
        padding-bottom: 0;
    }
    #view-dashboard .inc-tabs-bar > .btn {
        align-self: center;
        flex-shrink: 0;
    }

    /* Native Scrollbar-Free Swipe Strips ONLY for Sub-Tab Pills (No ugly grey bars!) */
    .inc-tabs,
    .att-subtabs:not(.adv-tabs-bar),
    .adv-tabs-strip,
    .adv-subtabs,
    .fd-preset-pills,
    .pe-close-presets,
    .doc-filter-bar,
    .prof-sec-tabs-bar {
        display: flex !important;
        flex-wrap: nowrap !important;
        align-items: center;
        gap: 6px !important;
        width: 100%;
        max-width: 100%;
        overflow-x: auto !important;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        touch-action: pan-x pan-y;
        scrollbar-width: none;
        -ms-overflow-style: none;
        padding-bottom: 2px;
    }
    .inc-tabs::-webkit-scrollbar,
    .att-subtabs:not(.adv-tabs-bar)::-webkit-scrollbar,
    .adv-tabs-strip::-webkit-scrollbar,
    .adv-subtabs::-webkit-scrollbar,
    .fd-preset-pills::-webkit-scrollbar,
    .pe-close-presets::-webkit-scrollbar,
    .doc-filter-bar::-webkit-scrollbar,
    .prof-sec-tabs-bar::-webkit-scrollbar {
        display: none;
        height: 0;
    }

    /* Action Button Groups WRAP cleanly into neat rows — ZERO buttons cut off off-screen! */
    .inc-tabs-bar > div[style*="display:flex"],
    .inc-tabs-bar > div[style*="display: flex"],
    .action-bar > div[style*="display:flex"],
    .action-bar > div[style*="display: flex"],
    .sav-tabs-bar > div[style*="display:flex"],
    .sav-tabs-bar > div[style*="display: flex"] {
        display: flex !important;
        flex-wrap: wrap !important;
        align-items: stretch;
        gap: 6px !important;
        width: 100%;
        max-width: 100%;
        overflow-x: visible !important;
        padding-bottom: 0;
    }
    .inc-tabs-bar > div[style*="display:flex"] > .btn,
    .inc-tabs-bar > div[style*="display: flex"] > .btn,
    .action-bar > div[style*="display:flex"] > .btn,
    .action-bar > div[style*="display: flex"] > .btn,
    .sav-tabs-bar > div[style*="display:flex"] > .btn,
    .sav-tabs-bar > div[style*="display: flex"] > .btn {
        flex: 1 1 calc(50% - 4px);
        min-width: 0;
        justify-content: center;
        text-align: center;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .action-bar > div[style*="display:flex"] > .btn-primary,
    .action-bar > div[style*="display: flex"] > .btn-primary,
    .action-bar > div[style*="display:flex"] > .btn-accent,
    .action-bar > div[style*="display: flex"] > .btn-accent,
    .inc-tabs-bar > div[style*="display:flex"] > .btn-primary:last-child:nth-child(odd),
    .inc-tabs-bar > div[style*="display: flex"] > .btn-primary:last-child:nth-child(odd) {
        flex: 1 1 100%;
    }
    .action-bar > div[style*="display:flex"] > .date-range-field,
    .action-bar > div[style*="display: flex"] > .date-range-field {
        flex: 1 1 100%;
        width: 100%;
    }

    /* Keep every tab pill inside swipeable strips crisp and single-line */
    .inc-tab-btn,
    .att-subtab-btn,
    .adv-subtab-btn,
    .fd-preset-btn,
    .doc-filter-pill,
    .prof-sec-tab,
    .inc-subpill,
    .pe-close-presets > * {
        white-space: nowrap !important;
        flex-shrink: 0 !important;
    }
    .att-subtab-btn,
    .inc-tab-btn,
    .adv-subtab-btn {
        padding: 7px 11px;
        font-size: 0.79rem;
    }
    .adv-subtabs {
        padding: 4px;
        background: #f1f5f9;
        border-radius: 10px;
    }
    .adv-primary-cta {
        width: 100%;
    }

    /* ── Clean Mobile Filter Toolbar Card ── */
    .action-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        background: #ffffff;
        border: 1px solid var(--border);
        border-radius: 12px;
        padding: 11px 12px;
        box-shadow: 0 1px 4px rgba(15, 23, 42, 0.04);
        margin-bottom: 14px !important;
        width: 100%;
        max-width: 100%;
    }
    .filter-group {
        width: 100%;
        max-width: 100%;
        gap: 8px !important;
    }
    /* Prevent iOS Safari viewport auto-zoom on input focus */
    .form-control,
    .login-input,
    .date-range-field input[type="date"] {
        font-size: 16px;
    }
    .filter-group > input[type="text"],
    .filter-group > .esp-wrap,
    .filter-group > .esp-wrap.esp-filter-mode {
        flex: 1 1 100% !important;
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
    }
    .filter-group > select,
    .filter-group > input[type="number"] {
        flex: 1 1 calc(50% - 4px) !important;
        width: auto !important;
        min-width: 120px !important;
        max-width: 100% !important;
    }
    .filter-group > .date-range-field {
        flex: 1 1 100%;
        width: 100%;
        height: 40px;
    }
    .filter-group > .date-range-group,
    .fd-preset-bar .date-range-group {
        flex: 1 1 100%;
        width: 100%;
        display: flex;
        flex-wrap: nowrap;
        gap: 6px;
    }
    .date-range-group .date-range-field {
        flex: 1 1 0;
        min-width: 0;
        height: 40px;
        padding: 0 5px 0 7px;
        gap: 4px;
    }
    .date-range-group .date-range-field label {
        font-size: 0.64rem;
    }
    .date-range-field input[type="date"] {
        width: 100% !important;
        min-width: 0 !important;
        flex: 1;
        height: 36px;
        font-size: 13.5px;
    }
    #attHistMonthWrap {
        flex: 1 1 100%;
        width: 100%;
        display: flex !important;
        gap: 8px;
    }
    #attHistMonthWrap > select,
    #attHistMonthWrap > input {
        flex: 1 1 0 !important;
        width: auto !important;
        min-width: 0 !important;
    }
    .date-mode-toggle {
        flex: 1 1 100%;
        display: flex;
        width: 100%;
    }
    .date-mode-btn {
        flex: 1;
        text-align: center;
        padding: 7px 10px;
    }
    .esp-dropdown {
        min-width: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
    }
    .fd-preset-bar {
        flex-direction: column;
        align-items: stretch;
        padding: 11px 12px;
        gap: 10px;
    }
    .fd-section-title {
        flex-wrap: wrap;
        gap: 4px;
        font-size: 0.74rem;
    }

    /* ── Executive 2-Column Compact KPI Cards ── */
    .stats-row,
    .inc-summary-grid,
    .doc-summary-grid,
    .exp-budget-hero,
    .payroll-stats-6 {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 10px !important;
        margin-bottom: 14px !important;
    }
    .stat-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        padding: 12px 13px;
        border-left-width: 3px;
    }
    .stats-row > .stat-card:last-child:nth-child(odd),
    .inc-summary-grid > .stat-card:last-child:nth-child(odd),
    .doc-summary-grid > .stat-card:last-child:nth-child(odd),
    .exp-budget-hero > .exp-budget-card:last-child:nth-child(odd) {
        grid-column: 1 / -1;
        flex-direction: row;
        align-items: center;
        gap: 12px;
    }
    .stat-icon {
        width: 36px;
        height: 36px;
        border-radius: 9px;
    }
    .stat-icon svg {
        width: 18px;
        height: 18px;
    }
    .stat-details {
        width: 100%;
    }
    .stat-details .label {
        font-size: 0.7rem;
        line-height: 1.25;
    }
    .stat-details .value,
    .payroll-stats-6 .stat-details .value {
        font-size: 1.02rem;
        line-height: 1.2;
        word-break: break-word;
    }
    .stat-details .sub {
        font-size: 0.68rem;
        line-height: 1.3;
        word-break: break-word;
    }
    .exp-budget-card {
        padding: 12px 13px;
    }
    .exp-budget-val {
        font-size: 1.04rem;
    }

    /* ── Cards & Card Headers (Wrap Cleanly, Zero Cut-Off Buttons) ── */
    .card {
        margin-bottom: 14px;
    }
    .card-header {
        padding: 12px 13px;
        gap: 8px;
    }
    .card-header h3 {
        font-size: 0.93rem;
        line-height: 1.3;
    }
    .card-header > div[style*="display:flex"],
    .card-header > div[style*="display: flex"] {
        max-width: 100%;
        flex-wrap: wrap !important;
        overflow-x: visible;
        gap: 6px !important;
        padding-bottom: 0;
    }
    .card-header > div[style*="display:flex"] > *,
    .card-header > div[style*="display: flex"] > * {
        flex-shrink: 0;
        white-space: nowrap;
    }
    .card-body {
        padding: 12px 13px;
    }
    .sav-liability-banner,
    .doc-pending-banner,
    .inc-banner,
    .exp-info-note {
        font-size: 0.78rem;
        padding: 10px 12px;
    }

    /* ── Smooth 60fps Horizontal Table Scrolling (Never Traps Vertical Page Scroll!) ── */
    .table-responsive,
    .att-register-wrap,
    .adv-sheet-scroll {
        width: 100%;
        max-width: 100%;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
        touch-action: pan-x pan-y;
    }
    .table-responsive::-webkit-scrollbar,
    .att-register-wrap::-webkit-scrollbar,
    .adv-sheet-scroll::-webkit-scrollbar {
        height: 4px;
    }
    .table-responsive::-webkit-scrollbar-track,
    .att-register-wrap::-webkit-scrollbar-track,
    .adv-sheet-scroll::-webkit-scrollbar-track {
        background: #f1f5f9;
        border-radius: 999px;
    }
    .table-responsive::-webkit-scrollbar-thumb,
    .att-register-wrap::-webkit-scrollbar-thumb,
    .adv-sheet-scroll::-webkit-scrollbar-thumb {
        background: #cbd5e1;
        border-radius: 999px;
    }
    .data-table th,
    .data-table td {
        padding: 9px 10px;
        font-size: 0.8rem;
    }
    .data-table td.currency-aed,
    .data-table .badge,
    .data-table .adv-badge,
    .data-table .doc-badge {
        white-space: nowrap;
    }

    /* Compact sticky columns on Register / Advance / Savings Matrix Sheets */
    .att-register-table .att-sticky-id,
    .adv-sticky-col1 {
        width: 56px;
        min-width: 56px;
        max-width: 56px;
        padding-left: 4px;
        padding-right: 4px;
        font-size: 0.72rem;
    }
    .att-register-table .att-sticky-name,
    .adv-sticky-col2 {
        left: 56px;
        width: 122px;
        min-width: 122px;
        max-width: 122px;
        font-size: 0.76rem;
        padding-left: 7px;
        padding-right: 7px;
    }

    /* ── Financial Trend Chart Mobile Scrollable Container ── */
    .fd-chart-wrap {
        overflow-x: auto;
        justify-content: flex-start;
        gap: 8px;
        padding: 16px 10px 10px;
    }
    .fd-chart-col {
        min-width: 50px;
    }

    /* ── Modals: Native Bottom-Sheet Fit with Zero Horizontal Overflow ── */
    .modal-backdrop {
        padding: 8px 8px calc(8px + env(safe-area-inset-bottom, 0px));
        align-items: flex-end;
    }
    .modal-box,
    .modal-box.modal-lg {
        width: 100% !important;
        max-width: 100% !important;
        max-height: 92vh !important;
        max-height: 92dvh !important;
        border-radius: 16px 16px 10px 10px;
    }
    .modal-header {
        padding: 13px 15px;
    }
    .modal-header h3 {
        font-size: 1rem;
    }
    .modal-body {
        padding: 13px 15px;
    }
    .modal-footer {
        padding: 11px 15px;
        flex-wrap: wrap;
        gap: 8px;
    }
    .modal-footer .btn {
        flex: 1 1 auto;
    }
    .form-grid {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }
    .form-group.col-full {
        grid-column: span 1 !important;
    }
    /* Collapse fixed multi-column inline grids inside modals & payslips */
    .modal-body [style*="grid-template-columns:1fr 1fr 1fr 1fr"],
    .modal-body [style*="grid-template-columns: 1fr 1fr 1fr 1fr"],
    .modal-body [style*="grid-template-columns:repeat(4,1fr)"],
    .modal-body [style*="grid-template-columns: repeat(4, 1fr)"] {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
    .modal-body [style*="grid-template-columns:1fr 1fr 1fr"],
    .modal-body [style*="grid-template-columns: 1fr 1fr 1fr"],
    .modal-body [style*="grid-template-columns:1fr 1fr"],
    .modal-body [style*="grid-template-columns: 1fr 1fr"],
    .modal-body [style*="grid-template-columns:1fr 1.6fr"],
    .modal-body [style*="grid-template-columns: 1fr 1.6fr"],
    #profileTabContent [style*="grid-template-columns:1fr 1fr"],
    .adv-hist-summary,
    .payslip-grid {
        grid-template-columns: 1fr !important;
    }
    .prof-modal-top {
        padding: 14px 14px 10px !important;
    }
    #profileTabContent {
        padding: 12px !important;
    }
    .payslip-sheet {
        padding: 16px 14px;
    }
    .payslip-header {
        flex-direction: column;
        gap: 8px;
    }
    .payslip-total-box {
        padding: 13px 15px;
        font-size: 0.96rem;
        flex-wrap: wrap;
        gap: 6px;
    }
}

/* 4. Compact Phone Breakpoint (<= 520px) */
@media (max-width: 520px) {
    .header-date-badge {
        display: none;
    }
    .btn {
        padding: 8px 12px;
        font-size: 0.82rem;
    }
    .btn-sm {
        padding: 6px 10px;
        font-size: 0.76rem;
    }
    /* On narrow phones, freeze ONLY the Employee Name column so 31 days / 12 months have wide room */
    .att-register-table .att-sticky-id,
    .adv-sticky-col1 {
        position: static !important;
    }
    .att-register-table .att-sticky-name,
    .adv-sticky-col2 {
        left: 0 !important;
        width: 118px;
        min-width: 118px;
        max-width: 118px;
    }
    .login-wrap {
        min-height: 100vh;
        min-height: 100dvh;
        padding: 16px;
    }
    .login-card-body {
        padding: 26px 20px;
    }
    .login-company-name {
        font-size: 0.92rem;
    }
}

/* 5. Enhanced Print Mode */
@media print {
    .sidebar-overlay,
    .mobile-menu-btn,
    .sidebar-close-btn,
    .mobile-bottom-nav,
    .notif-bell-wrap,
    .header-profile-wrap,
    .header-brand-pill,
    .inc-tabs-bar,
    .fd-preset-bar,
    .filter-group {
        display: none !important;
    }
    .dash-two-col {
        grid-template-columns: 1fr 1fr !important;
    }
    body {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}
