/* ==========================================================
   WorkPulse & JKIT ERP - Mobile First Styling & Android UI
   ========================================================== */

:root {
  --primary: #4f46e5;
  --primary-dark: #3730a3;
  --primary-light: #eef2ff;
  --secondary: #06b6d4;
  --success: #10b981;
  --success-bg: #ecfdf5;
  --warning: #f59e0b;
  --warning-bg: #fffbeb;
  --danger: #ef4444;
  --danger-bg: #fef2f2;
  --surface: #ffffff;
  --background: #f8fafc;
  --card-bg: #ffffff;
  --text-primary: #0f172a;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --border: #e2e8f0;
  --border-focus: #818cf8;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: var(--background);
  color: var(--text-primary);
  line-height: 1.5;
  padding-bottom: 75px; /* Space for bottom mobile nav */
}

/* App Header */
.app-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-icon {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.15rem;
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.3);
}

.brand-text h1 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.brand-text span {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.contact-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #f1f5f9;
  color: var(--primary);
  border: 1px solid var(--border);
  padding: 5px 10px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  text-decoration: none;
  transition: var(--transition);
}

.contact-pill:hover {
  background: var(--primary-light);
  border-color: #c7d2fe;
}

.brand-contact-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid #a7f3d0;
}

.btn-icon-header {
  background: var(--primary-light);
  color: var(--primary);
  border: none;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.btn-icon-header:hover {
  background: var(--primary);
  color: #fff;
}

/* Main Container */
.main-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 16px;
}

/* Navigation Tabs (Desktop / Mobile Top) */
.nav-tabs {
  display: none;
  background: #fff;
  padding: 6px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}

@media (min-width: 768px) {
  .nav-tabs {
    display: flex;
    gap: 8px;
  }
}

.nav-tab-btn {
  flex: 1;
  padding: 10px 16px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.9rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: var(--transition);
}

.nav-tab-btn.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 10px rgba(79, 70, 229, 0.25);
}

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

@media (max-width: 767px) {
  body {
    padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px));
  }
}

@media (min-width: 768px) {
  .mobile-bottom-nav {
    display: none;
  }
  body {
    padding-bottom: 24px;
  }
}

.mobile-nav-item {
  background: none;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: var(--text-secondary);
  font-size: 0.62rem;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 2px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mobile-nav-item svg {
  width: 18px;
  height: 18px;
  stroke-width: 2;
  flex-shrink: 0;
}

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

.mobile-nav-item.active svg {
  stroke: var(--primary);
}

/* Content Views */
.view-section {
  display: none;
}

.view-section.active {
  display: block;
  animation: fadeIn 0.25s ease-out;
}

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

/* Common Card & Panel */
.card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  padding: 16px;
  margin-bottom: 16px;
}

.card-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.card-subtitle {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

/* Stat Metrics Grid */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

@media (min-width: 768px) {
  .metrics-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.metric-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.metric-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--primary);
}

.metric-card.purple::before { background: var(--primary); }
.metric-card.green::before { background: var(--success); }
.metric-card.amber::before { background: var(--warning); }
.metric-card.blue::before { background: var(--secondary); }

.metric-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.metric-val {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-top: 4px;
}

.metric-sub {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 2px;
}

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

.search-box {
  position: relative;
  flex: 1;
  min-width: 200px;
}

.search-box input {
  width: 100%;
  padding: 9px 12px 9px 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  outline: none;
  transition: var(--transition);
}

.search-box input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

.search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  width: 16px;
  height: 16px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-md);
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: var(--transition);
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}
.btn-primary:hover {
  background: var(--primary-dark);
}

.btn-secondary {
  background: #f1f5f9;
  color: var(--text-primary);
  border-color: var(--border);
}
.btn-secondary:hover {
  background: #e2e8f0;
}

.btn-success {
  background: var(--success);
  color: #fff;
}
.btn-success:hover {
  background: #059669;
}

.btn-sm {
  padding: 5px 10px;
  font-size: 0.78rem;
}

/* Responsive Table */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: #fff;
}

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

th {
  background: #f8fafc;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text-primary);
  white-space: nowrap;
}

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

tr:hover td {
  background: #fbfcfe;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 600;
}

.badge-full {
  background: #ecfdf5;
  color: #059669;
  border: 1px solid #a7f3d0;
}

.badge-half {
  background: #eff6ff;
  color: #2563eb;
  border: 1px solid #bfdbfe;
}

.badge-absent {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
}

.badge-leave {
  background: #fffbeb;
  color: #d97706;
  border: 1px solid #fde68a;
}

/* Status Select */
.status-select {
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  font-size: 0.84rem;
  font-weight: 600;
  outline: none;
  background-color: #fff;
  cursor: pointer;
  transition: var(--transition);
}

.status-select.status-Full-Day {
  background: #ecfdf5;
  color: #065f46;
  border-color: #a7f3d0;
}

.status-select.status-Half-Day {
  background: #eff6ff;
  color: #1e40af;
  border-color: #bfdbfe;
}

.status-select.status-Absent {
  background: #fef2f2;
  color: #991b1b;
  border-color: #fecaca;
}

.status-select.status-Paid-Leave {
  background: #fffbeb;
  color: #92400e;
  border-color: #fde68a;
}

/* Formula Banner */
.formula-banner {
  background: linear-gradient(135deg, #1e1b4b, #312e81);
  color: #e0e7ff;
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: 0 4px 12px rgba(49, 46, 129, 0.25);
}

.formula-banner .title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #a5b4fc;
  letter-spacing: 0.5px;
}

.formula-box {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.formula-item {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  font-family: monospace;
  font-size: 0.82rem;
  color: #ffffff;
}

.formula-item strong {
  color: #38bdf8;
}

/* Circular Employee Avatars & Upload Widget */
.avatar-upload-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.avatar-upload-circle {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  border: 3px solid #e0e7ff;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.15);
  position: relative;
  cursor: pointer;
  background: linear-gradient(135deg, #eef2ff, #e0e7ff);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.avatar-upload-circle:hover {
  transform: scale(1.03);
  border-color: var(--primary);
}

.avatar-preview-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.avatar-camera-badge {
  position: absolute;
  bottom: 0px;
  right: 0px;
  width: 28px;
  height: 28px;
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  border: 2px solid #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
}

.avatar-upload-hint {
  font-size: 0.74rem;
  color: var(--primary);
  font-weight: 700;
  margin-top: 6px;
  cursor: pointer;
}

/* List Row Employee Avatar */
.emp-avatar-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid #e2e8f0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.88rem;
}

/* Native Mobile Screens / Slide Over View (Service Mitra Style) */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-overlay.active {
  display: flex;
}

.modal-content {
  background: #fff;
  border-radius: var(--radius-lg);
  max-width: 540px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  padding: 20px;
  position: relative;
  animation: modalPop 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalPop {
  from { opacity: 0; transform: scale(0.94); }
  to { opacity: 1; transform: scale(1); }
}

/* On Mobile screens: Native Fullscreen Screen (Service Mitra / Native Android Style) */
@media (max-width: 768px) {
  .modal-overlay {
    padding: 0;
    align-items: flex-end;
  }
  .modal-content {
    max-width: 100% !important;
    width: 100% !important;
    height: 100% !important;
    max-height: 100vh !important;
    border-radius: 0 !important;
    padding: 16px;
    padding-bottom: 40px;
    display: flex;
    flex-direction: column;
    animation: slideUpMobile 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  }
  @keyframes slideUpMobile {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
  }
  .modal-header {
    padding-top: 10px;
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 10;
  }
}

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

.modal-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
}

.modal-close {
  background: #f1f5f9;
  border: none;
  font-size: 1.2rem;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.form-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 5px;
}

.form-control {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  outline: none;
  transition: var(--transition);
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

.auto-calc-box {
  background: #f8fafc;
  border: 1px dashed var(--primary);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 6px;
}

.auto-calc-label {
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.auto-calc-val {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--primary);
}

/* Toasts / Notifications */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  background: #ffffff;
  color: var(--text-primary);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  box-shadow: var(--shadow-lg);
  border-left: 4px solid var(--primary);
  font-size: 0.86rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 260px;
  max-width: 380px;
  animation: slideInRight 0.3s ease-out;
}

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

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: translateX(0); }
}

/* Printable Salary Slip Modal Display */
.slip-container {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  background: #ffffff;
  font-family: inherit;
}

.slip-header {
  text-align: center;
  border-bottom: 2px solid var(--primary);
  padding-bottom: 12px;
  margin-bottom: 16px;
}

.slip-company {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--primary);
  text-transform: uppercase;
}

.slip-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary);
}

.slip-meta-grid {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #f8fafc;
  padding: 12px;
  border-radius: var(--radius-sm);
  margin-bottom: 14px;
  border: 1px solid var(--border);
}

.slip-meta-details {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  font-size: 0.84rem;
  flex: 1;
}

.slip-meta-item strong {
  color: var(--text-secondary);
}

.slip-table {
  width: 100%;
  margin-bottom: 14px;
}

.slip-table th {
  background: #f1f5f9;
}

.slip-total-box {
  background: var(--primary-light);
  border: 1px solid #c7d2fe;
  border-radius: var(--radius-md);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.slip-total-label {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--primary-dark);
}

.slip-total-amount {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--primary-dark);
}

/* Auth Modal & Header Styles */
.auth-tab-btn {
  flex: 1;
  padding: 8px 12px;
  font-size: 0.84rem;
  font-weight: 600;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}

.auth-tab-btn.active {
  background: #ffffff;
  color: var(--primary);
  font-weight: 700;
  box-shadow: var(--shadow-sm);
}

.company-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #eef2ff;
  color: var(--primary);
  border: 1px solid #c7d2fe;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
}

.company-pill:hover {
  background: #e0e7ff;
}

/* Reports Canvas Container */
.chart-container {
  position: relative;
  width: 100%;
  height: 260px;
  background: #ffffff;
  border-radius: var(--radius-md);
  margin-top: 10px;
}

.chart-legend {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 12px;
  font-size: 0.78rem;
  font-weight: 600;
}

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

.legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  display: inline-block;
}

/* Holiday Badges */
.badge-holiday {
  display: inline-block;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
}

.badge-holiday.public {
  background: #fee2e2;
  color: #dc2626;
  border: 1px solid #fca5a5;
}

.badge-holiday.company {
  background: #eef2ff;
  color: #4f46e5;
  border: 1px solid #c7d2fe;
}

.badge-holiday.optional {
  background: #fef3c7;
  color: #d97706;
  border: 1px solid #fde68a;
}

/* 1-Tap Quick Attendance Pills (PagarBook Style) */
.punch-btn-group {
  display: inline-flex;
  gap: 5px;
  flex-wrap: wrap;
}

.punch-pill {
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 700;
  border: 1px solid var(--border);
  background: #f8fafc;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
}

.punch-pill:hover {
  border-color: var(--primary);
}

.punch-pill.active-full {
  background: #10b981;
  color: #ffffff;
  border-color: #059669;
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.25);
}

.punch-pill.active-half {
  background: #06b6d4;
  color: #ffffff;
  border-color: #0891b2;
  box-shadow: 0 2px 6px rgba(6, 182, 212, 0.25);
}

.punch-pill.active-leave {
  background: #f59e0b;
  color: #ffffff;
  border-color: #d97706;
  box-shadow: 0 2px 6px rgba(245, 158, 11, 0.25);
}

.punch-pill.active-absent {
  background: #ef4444;
  color: #ffffff;
  border-color: #dc2626;
  box-shadow: 0 2px 6px rgba(239, 68, 68, 0.25);
}

/* WhatsApp Direct Share Button */
.btn-whatsapp {
  background: #25D366;
  color: #ffffff;
  border: 1px solid #1da851;
}

.btn-whatsapp:hover {
  background: #1da851;
  color: #ffffff;
}

/* Staff Digital ID Card */
.id-card-preview {
  width: 310px;
  margin: 0 auto;
  border: 2px solid #c7d2fe;
  border-radius: 16px;
  overflow: hidden;
  background: #ffffff;
  box-shadow: 0 10px 25px rgba(79, 70, 229, 0.15);
  text-align: center;
}

.id-card-top {
  background: linear-gradient(135deg, #4f46e5, #06b6d4);
  color: #ffffff;
  padding: 18px 14px 36px 14px;
}

.id-card-avatar-wrap {
  margin-top: -32px;
  display: flex;
  justify-content: center;
}

.id-card-avatar {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  border: 3px solid #ffffff;
  background: #eef2ff;
  object-fit: cover;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--primary);
}

.id-card-body {
  padding: 12px 18px 18px 18px;
}

/* Khatabook-style Live Employee Passbook Fullscreen View */
.passbook-view {
  max-width: 760px;
  margin: 16px auto;
  padding: 0 12px 40px 12px;
}

.passbook-header-card {
  background: linear-gradient(135deg, #3730a3, #4f46e5);
  color: #ffffff;
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-lg);
}

.time-input-mini {
  padding: 4px 6px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.76rem;
  width: 76px;
}

/* ==========================================================
   PRINT STYLES - FLAWLESS EXPORT & CLEAN PRINT
   ========================================================== */
@media print {
  @page {
    size: auto;
    margin: 8mm;
  }

  body {
    background: #ffffff !important;
    color: #0f172a !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  /* When printing from modal or when printing-modal class is present, hide all dashboard and tabs */
  body.printing-modal .app-header,
  body.printing-modal .nav-tabs,
  body.printing-modal .mobile-bottom-nav,
  body.printing-modal .action-bar,
  body.printing-modal .metrics-grid,
  body.printing-modal .formula-banner,
  body.printing-modal .tab-pane,
  body.printing-modal .main-container,
  body:has(.modal-overlay.active) .app-header,
  body:has(.modal-overlay.active) .nav-tabs,
  body:has(.modal-overlay.active) .mobile-bottom-nav,
  body:has(.modal-overlay.active) .action-bar,
  body:has(.modal-overlay.active) .metrics-grid,
  body:has(.modal-overlay.active) .formula-banner,
  body:has(.modal-overlay.active) .tab-pane,
  body:has(.modal-overlay.active) .main-container,
  .toast-container,
  .contact-pill,
  .company-pill,
  .modal-close,
  button,
  .btn,
  .btn-whatsapp {
    display: none !important;
  }

  /* Inactive modals MUST remain completely hidden */
  .modal-overlay:not(.active) {
    display: none !important;
  }

  /* Only active modal displays cleanly as a printable document */
  .modal-overlay.active {
    position: static !important;
    background: transparent !important;
    backdrop-filter: none !important;
    display: block !important;
    padding: 0 !important;
    margin: 0 auto !important;
    width: 100% !important;
    height: auto !important;
  }

  .modal-overlay.active .modal-content {
    box-shadow: none !important;
    border: none !important;
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
    padding: 0 !important;
    margin: 0 auto !important;
    overflow: visible !important;
  }

  .modal-overlay.active .modal-header,
  .modal-overlay.active .modal-content > div:last-child {
    display: none !important; /* Hide Close and Print buttons */
  }

  #printableIdCard {
    margin: 10mm auto !important;
    box-shadow: none !important;
    border: 2px solid #4f46e5 !important;
    page-break-inside: avoid !important;
  }

  #printablePassbookArea {
    margin: 0 auto !important;
    box-shadow: none !important;
    page-break-inside: avoid !important;
  }

  /* Ensure colors and background gradients render accurately in PDF print */
  * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
}



