/* Payslip Document Clone - Print Optimized */
:root {
  --primary: #2f6fed;
  --border: #e5e7eb;
  --text: #111827;
  --muted: #6b7280;
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  line-height: 1.6;
  color: var(--text);
  max-width: 800px;
  margin: 0 auto;
  padding: 40px 20px;
  background: white;
}

.payslip-container {
  background: white;
  box-shadow: 0 10px 50px rgba(0,0,0,0.1);
  border-radius: 12px;
  overflow: hidden;
}

.payslip-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 30px;
  display: flex;
  align-items: center;
  gap: 20px;
}

.logo { height: 50px; }

.company-details h2 { margin: 0; font-size: 24px; }
.company-details p { margin: 5px 0 0; opacity: 0.9; }

.employee-info {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  padding: 30px;
  border-bottom: 1px solid var(--border);
}

.employee-info p { margin: 8px 0; font-size: 15px; }

.earnings-section, .deductions-section {
  padding: 30px;
  page-break-inside: avoid;
}

h3 { 
  color: var(--primary); 
  margin-bottom: 20px; 
  font-size: 18px; 
  font-weight: 600;
}

.payslip-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 20px;
  font-size: 14px;
}

.payslip-table th {
  background: #f8fafc;
  padding: 12px 16px;
  text-align: left;
  font-weight: 600;
  border-bottom: 2px solid var(--border);
}

.payslip-table td {
  padding: 12px 16px;
  border-bottom: 1px solid #f1f5f9;
}

.total-row td { 
  font-weight: 700; 
  background: #f8fafc;
  border-top: 2px solid var(--primary);
}

.summary-table {
  width: 50%;
  margin: 30px auto 0;
  background: #f8fafc;
  border-radius: 8px;
  overflow: hidden;
}

.summary-table tr td {
  padding: 16px 24px;
}

.summary-table tr td:first-child { font-weight: 600; }
.net-row { background: var(--primary); color: white; font-weight: 700; }

.payslip-footer {
  padding: 30px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--muted);
}

.signature-line {
  height: 1px;
  background: var(--border);
  width: 120px;
  margin-top: 50px;
}

.print-actions {
  text-align: center;
  padding: 20px;
  background: #f8fafc;
}

.print-btn {
  background: var(--primary);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  margin-right: 12px;
}

.close-btn {
  background: white;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 12px 24px;
  border-radius: 8px;
  cursor: pointer;
}

@media print {
  body { -webkit-print-color-adjust: exact; }
  .print-actions { display: none; }
  .payslip-container { box-shadow: none; border-radius: 0; }
}

@media (max-width: 768px) {
  .employee-info { grid-template-columns: 1fr; gap: 20px; }
  .payslip-header { flex-direction: column; text-align: center; gap: 15px; }
}
