/* ============================================================ */
/* SHRIPAL GROUP ATTENDANCE & HR CRM MANAGEMENT SYSTEM          */
/* Colors: Pure White (#FFF), Brand Red (#DC2626), Slate (#0F172A)*/
/* Design: Enterprise CRM on Desktop, App-Like on Mobile        */
/* ============================================================ */

:root {
  /* Brand Red Palette */
  --primary: #DC2626;
  --primary-hover: #B91C1C;
  --primary-light: #FEF2F2;
  --primary-border: #FEE2E2;
  --primary-shadow: rgba(220, 38, 38, 0.25);

  /* Deep Slate / Black Palette (5-10% Accent) */
  --dark: #0F172A;
  --dark-hover: #1E293B;
  --dark-subtle: #334155;
  --dark-border: #1E293B;

  /* Clean Canvas & Card Backgrounds */
  --bg-main: #F8FAFC;
  --bg-card: #FFFFFF;
  --bg-light: #F1F5F9;
  --border-color: #E2E8F0;
  --border-light: #F1F5F9;

  /* Typography */
  --text-dark: #0F172A;
  --text-body: #334155;
  --text-muted: #64748B;

  /* Enterprise Status Colors */
  --success: #059669;
  --success-bg: #ECFDF5;
  --success-border: #A7F3D0;
  --warning: #D97706;
  --warning-bg: #FFFBEB;
  --warning-border: #FDE68A;
  --danger: #DC2626;
  --danger-bg: #FEF2F2;
  --danger-border: #FECACA;
  --pink: #DB2777;
  --pink-bg: #FDF2F8;
  --pink-border: #FBCFE8;
  --info: #0284C7;
  --info-bg: #E0F2FE;
  --info-border: #BAE6FD;

  /* Spacing & Radii */
  --radius-xl: 16px;
  --radius-lg: 12px;
  --radius-md: 8px;
  --radius-sm: 6px;

  /* Refined CRM Shadows */
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-dark);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  padding-bottom: 74px; /* Space for mobile bottom bar */
}

@media (min-width: 1024px) {
  body {
    padding-bottom: 0;
  }
}

/* Subtle Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-thumb {
  background: #CBD5E1;
  border-radius: 4px;
}

/* ============================================================ */
/* 1. APP HEADER & DESKTOP SIDEBAR                              */
/* ============================================================ */
.app-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: #FFFFFF;
  border-bottom: 1px solid var(--border-color);
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-xs);
}

.brand-logo-img {
  height: 40px;
  max-width: 190px;
  object-fit: contain;
}

.desktop-layout {
  display: flex;
  min-height: calc(100vh - 65px);
}

.desktop-sidebar {
  width: 250px;
  background: #FFFFFF;
  border-right: 1px solid var(--border-color);
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-shrink: 0;
}

.desktop-content {
  flex: 1;
  padding: 24px 32px;
  max-width: 1300px;
  min-width: 0;
}

@media (max-width: 1023px) {
  .desktop-sidebar {
    display: none;
  }
  .desktop-content {
    padding: 16px;
  }
}

/* Sidebar Section Headers */
.sidebar-section-title {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.9px;
  color: #94A3B8;
  padding: 14px 12px 4px;
}

/* Sidebar Links */
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  color: var(--text-body);
  text-decoration: none;
  font-weight: 500;
  font-size: 13.5px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.sidebar-link svg {
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  flex-shrink: 0;
  transition: color 0.15s ease;
}

.sidebar-link:hover {
  background: #F1F5F9;
  color: var(--dark);
}

.sidebar-link:hover svg {
  color: var(--primary);
}

/* Only the active sidebar link gets highlighted in brand red */
.sidebar-link.active {
  background: var(--primary);
  color: #FFFFFF !important;
  font-weight: 600;
  box-shadow: 0 2px 6px var(--primary-shadow);
}

.sidebar-link.active svg {
  color: #FFFFFF !important;
  stroke: #FFFFFF !important;
}

/* Mobile Bottom Navigation Bar */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 64px;
  background: #FFFFFF;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 50;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.04);
}

@media (min-width: 1024px) {
  .bottom-nav {
    display: none;
  }
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 10.5px;
  font-weight: 600;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
  flex: 1;
  text-decoration: none;
}

.nav-item svg {
  width: 20px;
  height: 20px;
  margin-bottom: 2px;
  transition: transform 0.15s;
}

.nav-item.active {
  color: var(--primary);
}

.nav-item.active svg {
  stroke: var(--primary);
  transform: translateY(-1px);
}

/* ============================================================ */
/* 2. ENTERPRISE CRM HEADERS & CONTROLS                         */
/* ============================================================ */
.crm-page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-color);
}

.crm-header-title-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.crm-header-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  background: #FEF2F2;
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid var(--primary-border);
}

.crm-header-icon svg {
  width: 22px;
  height: 22px;
}

.crm-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--dark);
  line-height: 1.2;
}

.crm-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 3px;
}

.crm-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

@media (max-width: 640px) {
  .crm-page-header {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  .crm-header-actions {
    width: 100%;
    justify-content: stretch;
  }
  .crm-header-actions > * {
    flex: 1;
  }
}

/* ============================================================ */
/* 3. CRM TABLES & DATA GRIDS                                   */
/* ============================================================ */
.crm-table-container {
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
}

.crm-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  text-align: left;
  font-size: 13px;
}

.crm-table th {
  background: #F8FAFC;
  padding: 12px 16px;
  font-size: 11px;
  font-weight: 700;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

.crm-table td {
  padding: 14px 16px;
  color: var(--text-dark);
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
}

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

.crm-table tr:hover td {
  background: #F8FAFC;
}

/* Employee Avatar in tables */
.emp-avatar-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.emp-avatar-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #F1F5F9;
  color: var(--dark);
  font-weight: 700;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid #CBD5E1;
}

.emp-name-text {
  font-weight: 700;
  color: var(--dark);
  line-height: 1.2;
}

.emp-sub-text {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Quote/Reason box */
.crm-reason-box {
  background: #F8FAFC;
  border: 1px solid var(--border-color);
  border-left: 3px solid #CBD5E1;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 12px;
  color: #475569;
  max-width: 280px;
  word-break: break-word;
}

/* Clean status badges with colored dot indicator (No emojis) */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-pending { background: #FFFBEB; color: #B45309; border: 1px solid #FDE68A; }
.status-pending .status-dot { background: #D97706; }

.status-approved { background: #FDF2F8; color: #BE185D; border: 1px solid #FBCFE8; }
.status-approved .status-dot { background: #DB2777; }

.status-rejected { background: #FEF2F2; color: #B91C1C; border: 1px solid #FECACA; }
.status-rejected .status-dot { background: #DC2626; }

.status-present { background: #ECFDF5; color: #047857; border: 1px solid #A7F3D0; }
.status-present .status-dot { background: #059669; }

.status-absent { background: #FEF2F2; color: #B91C1C; border: 1px solid #FECACA; }
.status-absent .status-dot { background: #DC2626; }

.status-halfday { background: #FFFBEB; color: #B45309; border: 1px solid #FDE68A; }
.status-halfday .status-dot { background: #D97706; }

.status-weekoff { background: #ECFDF5; color: #047857; border: 1px solid #A7F3D0; }
.status-weekoff .status-dot { background: #059669; }

.status-gray { background: #F1F5F9; color: #64748B; border: 1px solid #E2E8F0; }
.status-gray .status-dot { background: #94A3B8; }

/* Mobile CRM Micro Cards */
.emp-mobile-cards {
  display: none;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}

@media (max-width: 768px) {
  .emp-table-wrapper {
    display: none !important;
  }
  .emp-mobile-cards {
    display: flex !important;
  }
}

.emp-card-item {
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: var(--shadow-xs);
}

/* ============================================================ */
/* 4. EXECUTIVE DASHBOARD & PROJECT FILTER                      */
/* ============================================================ */
.dash-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}

.dash-controls-row {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

@media (max-width: 768px) {
  .dash-top-bar {
    flex-direction: column;
    align-items: stretch;
    padding: 14px;
    gap: 12px;
  }
  .dash-controls-row {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .dash-controls-row .form-group {
    width: 100% !important;
  }
  .dash-controls-row > div:last-child {
    display: flex;
    gap: 8px;
    width: 100%;
  }
  .dash-controls-row > div:last-child button {
    flex: 1;
  }
}

/* KPI Summary Grid */
.dashboard-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

@media (max-width: 640px) {
  .dashboard-kpi-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
}

.dashboard-kpi-card {
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px 12px;
  text-align: center;
  box-shadow: var(--shadow-xs);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.dashboard-kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.kpi-icon {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
}

.kpi-icon svg {
  width: 20px;
  height: 20px;
}

.icon-blue { background: #EFF6FF; color: #2563EB; }
.icon-green { background: #ECFDF5; color: #059669; }
.icon-red { background: #FEF2F2; color: #DC2626; }
.icon-yellow { background: #FFFBEB; color: #D97706; }
.icon-pink { background: #FDF2F8; color: #DB2777; }

.kpi-value {
  font-size: 24px;
  font-weight: 800;
  line-height: 1.1;
  color: var(--text-dark);
  margin-bottom: 2px;
}

.kpi-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}

.kpi-subtext {
  font-size: 10px;
  color: #94A3B8;
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* Project Summary Cards */
.project-summary-card {
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 18px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-xs);
  transition: all 0.2s ease;
}

.project-summary-card:hover {
  border-color: #CBD5E1;
  box-shadow: var(--shadow-sm);
}

.project-progress-track {
  width: 100%;
  height: 8px;
  background: #F1F5F9;
  border-radius: 4px;
  overflow: hidden;
  margin: 10px 0 14px;
}

.project-progress-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.3s ease;
}

.stat-pill {
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #F8FAFC;
  border: 1px solid var(--border-color);
  color: var(--text-dark);
}

.pill-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
}

.pill-dot-green { background: #16A34A; }
.pill-dot-red { background: #DC2626; }
.pill-dot-yellow { background: #D97706; }
.pill-dot-pink { background: #DB2777; }
.pill-dot-gray { background: #94A3B8; }

.dashboard-leaves-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
}

@media (max-width: 768px) {
  .dashboard-leaves-grid {
    grid-template-columns: 1fr;
  }
}

/* ============================================================ */
/* 5. CARDS, FORMS & BUTTON SYSTEM                              */
/* ============================================================ */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  padding: 18px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-xs);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-color);
}

.card-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-dark);
  display: flex;
  align-items: center;
  gap: 8px;
}

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

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: #475569;
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  padding: 9px 12px;
  font-size: 13px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: #FFFFFF;
  color: var(--text-dark);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s ease;
  text-decoration: none;
  user-select: none;
  white-space: nowrap;
}

.btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.btn-primary {
  background: var(--primary);
  color: #FFFFFF;
  box-shadow: 0 2px 4px var(--primary-shadow);
}

.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-secondary {
  background: #FFFFFF;
  color: var(--dark);
  border-color: var(--border-color);
}

.btn-secondary:hover {
  background: #F8FAFC;
  border-color: #CBD5E1;
}

.btn-dark {
  background: var(--dark);
  color: #FFFFFF;
}

.btn-dark:hover {
  background: var(--dark-hover);
}

.btn-success {
  background: var(--success);
  color: #FFFFFF;
}

.btn-success:hover {
  background: #047857;
}

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

.btn-danger:hover {
  background: var(--danger-bg);
}

.btn-sm {
  padding: 5px 10px;
  font-size: 12px;
  border-radius: var(--radius-sm);
}

.btn-sm svg {
  width: 14px;
  height: 14px;
}

.btn-block {
  width: 100%;
}

/* ============================================================ */
/* 6. PUNCH CLOCK & CALENDAR VIEW                               */
/* ============================================================ */
.punch-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 24px 16px;
  background: #FFFFFF;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
}

.live-clock {
  font-size: 38px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--text-dark);
  font-variant-numeric: tabular-nums;
  margin-bottom: 2px;
}

.live-date {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 18px;
}

.punch-btn-wrapper {
  position: relative;
  margin: 14px 0;
}

.punch-big-btn {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  border: none;
  color: #FFFFFF;
  font-size: 17px;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-shadow: 0 10px 24px rgba(220, 38, 38, 0.3);
  transition: all 0.2s ease;
  user-select: none;
  background: linear-gradient(135deg, #DC2626 0%, #B91C1C 100%);
}

.punch-big-btn:active {
  transform: scale(0.95);
}

.punch-big-btn.btn-out {
  background: linear-gradient(135deg, #0F172A 0%, #1E293B 100%);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.3);
}

.punch-big-btn.btn-disabled {
  background: #94A3B8;
  box-shadow: none;
  cursor: not-allowed;
  opacity: 0.7;
}

.pulse-ring {
  position: absolute;
  top: -6px;
  left: -6px;
  right: -6px;
  bottom: -6px;
  border-radius: 50%;
  border: 3px solid rgba(220, 38, 38, 0.35);
  animation: pulse-animation 2s infinite;
  pointer-events: none;
}

@keyframes pulse-animation {
  0% { transform: scale(0.96); opacity: 0.8; }
  50% { transform: scale(1.08); opacity: 0.2; }
  100% { transform: scale(0.96); opacity: 0.8; }
}

.geo-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 30px;
  font-size: 12px;
  font-weight: 600;
  margin-top: 10px;
}

.geo-in-range {
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid var(--success-border);
}

.geo-out-range {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid var(--danger-border);
}

/* Calendar Grid */
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  margin-top: 12px;
}

.cal-header-cell {
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  padding: 6px 0;
  text-transform: uppercase;
}

.cal-day-cell {
  position: relative;
  min-height: 58px;
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 6px 4px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.cal-day-cell:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.cal-day-num {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-dark);
}

.cal-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  margin: 2px 0;
}

.dot-green { background: var(--success); }
.dot-yellow { background: var(--warning); }
.dot-red { background: var(--danger); }
.dot-pink { background: var(--pink); }
.dot-gray { background: #CBD5E1; }

.cal-hours-text {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
}

.cal-day-cell.day-green {
  background: #F0FDF4;
  border-color: #BBF7D0;
}

.cal-day-cell.day-yellow {
  background: #FEFCE8;
  border-color: #FEF08A;
}

.cal-day-cell.day-red {
  background: #FEF2F2;
  border-color: #FECACA;
}

.cal-day-cell.day-pink {
  background: #FDF2F8;
  border-color: #FBCFE8;
}

.cal-day-cell.day-weekend, .cal-day-cell.day-future {
  background: #F8FAFC;
  opacity: 0.6;
}

/* Legend */
.calendar-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border-color);
  font-size: 11px;
  color: var(--text-muted);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.legend-color {
  width: 12px;
  height: 12px;
  border-radius: 3px;
}

/* ============================================================ */
/* 7. MODALS, TOASTS & PRINT                                    */
/* ============================================================ */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(2px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-dialog {
  background: #FFFFFF;
  border-radius: var(--radius-lg);
  max-width: 540px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
  transform: translateY(20px);
  transition: transform 0.2s ease;
}

.modal-overlay.active .modal-dialog {
  transform: translateY(0);
}

.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-dark);
}

.modal-close {
  background: none;
  border: none;
  font-size: 22px;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
}

.modal-body {
  padding: 20px;
}

.modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* Toasts */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 150;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  padding: 12px 18px;
  background: #FFFFFF;
  border-radius: var(--radius-md);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  border-left: 4px solid var(--primary);
  font-size: 13.5px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slide-in 0.3s ease;
  min-width: 280px;
  max-width: 380px;
}

.toast-success { border-left-color: var(--success); }
.toast-danger { border-left-color: var(--danger); }
.toast-warning { border-left-color: var(--warning); }

@keyframes slide-in {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* Payslip Sheet Print */
.payslip-sheet {
  background: #FFFFFF;
  padding: 30px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  max-width: 800px;
  margin: 0 auto;
  box-shadow: var(--shadow-sm);
}

.payslip-header-bar {
  background: var(--primary);
  color: #FFFFFF;
  padding: 8px 16px;
  text-align: center;
  font-weight: 800;
  font-size: 15px;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-top: 14px;
  margin-bottom: 16px;
}

@media print {
  body {
    background: #FFFFFF;
    padding: 0;
  }
  .app-header, .bottom-nav, .desktop-sidebar, .no-print {
    display: none !important;
  }
  .desktop-content {
    padding: 0;
  }
  .payslip-sheet {
    border: none;
    box-shadow: none;
    padding: 0;
    max-width: 100%;
  }
}

/* ============================================================ */
/* 9. DAILY TASKS & SELFIE GALLERY STYLES                       */
/* ============================================================ */
.selfie-card {
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-xs);
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
}

.selfie-card:hover {
  border-color: #CBD5E1;
  box-shadow: var(--shadow-sm);
}

.selfie-duo-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 12px 0;
}

.selfie-thumb-box {
  position: relative;
  width: 100%;
  height: 160px;
  background: #0F172A;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.selfie-thumb-box:hover {
  transform: scale(1.02);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.selfie-thumb-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.selfie-thumb-tag {
  position: absolute;
  bottom: 6px;
  left: 6px;
  right: 6px;
  background: rgba(15, 23, 42, 0.85);
  color: #FFFFFF;
  font-size: 10.5px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 4px;
  backdrop-filter: blur(4px);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.selfie-empty-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #64748B;
  background: #F1F5F9;
  font-size: 11px;
  text-align: center;
  padding: 10px;
}

