/* ===== GLOBAL STYLES & DESIGN SYSTEM ===== */
:root {
  --primary-blue: #1e40af;
  --primary-blue-light: #3b82f6;
  --primary-blue-dark: #1e3a8a;
  --success-green: #16a34a;
  --warning-orange: #ea580c;
  --danger-red: #dc2626;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-500: #6b7280;
  --gray-700: #374151;
  --gray-900: #111827;
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--gray-50);
  color: var(--gray-900);
  line-height: 1.6;
}

/* ===== UTILITY CLASSES ===== */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

.card {
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  border: 1px solid var(--gray-200);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  gap: 0.5rem;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--primary-blue);
  color: white;
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-blue-dark);
}

.btn-success {
  background: var(--success-green);
  color: white;
}

.btn-danger {
  background: var(--danger-red);
  color: white;
}

.btn-warning {
  background: var(--warning-orange);
  color: white;
}

/* ===== NAVIGATION ===== */
.navbar {
  background: var(--primary-blue);
  color: white;
  padding: 1rem 0;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.nav-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand {
  font-size: 1.5rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
}

.nav-links a {
  color: white;
  text-decoration: none;
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  transition: background 0.2s ease;
}

.nav-links a:hover,
.nav-links a.active {
  background: rgba(255, 255, 255, 0.1);
}

/* ===== KPI CARDS ===== */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

.kpi-card {
  padding: 1.5rem;
  border-radius: 12px;
  color: white;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.kpi-card.blue { background: linear-gradient(135deg, var(--primary-blue), var(--primary-blue-light)); }
.kpi-card.orange { background: linear-gradient(135deg, var(--warning-orange), #f97316); }
.kpi-card.red { background: linear-gradient(135deg, var(--danger-red), #ef4444); }
.kpi-card.green { background: linear-gradient(135deg, var(--success-green), #22c55e); }

.kpi-icon {
  width: 3rem;
  height: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
}

.kpi-value {
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1;
}

.kpi-label {
  font-size: 0.875rem;
  opacity: 0.9;
  margin-top: 0.25rem;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
  .nav-links {
    display: none;
  }
  
  .kpi-grid {
    grid-template-columns: 1fr;
  }
  
  .container {
    padding: 0 0.5rem;
  }
}

/* ===== LOADING STATES ===== */
.loading {
  opacity: 0.7;
  pointer-events: none;
}

.spinner {
  border: 2px solid #f3f3f3;
  border-top: 2px solid var(--primary-blue);
  border-radius: 50%;
  width: 20px;
  height: 20px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* ===== SCANNER SPECIFIC STYLES ===== */
.waiting-scanner {
    width: 100%;
    height: 300px;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    animation: breathe 2s infinite ease-in-out;
}

@keyframes breathe {
    0%, 100% { box-shadow: 0 0 20px rgba(30, 64, 175, 0.3); }
    50% { box-shadow: 0 0 30px rgba(30, 64, 175, 0.6); }
}

.scan-success {
    background-color: #f0fdf4 !important;
    border-color: #16a34a !important;
    animation: none !important;
}

.scan-fail {
    background-color: #fef2f2 !important;
    border-color: #dc2626 !important;
    animation: none !important;
}

.staff-photo {
    width: 130px;
    height: 130px;
    border-radius: 50%;
    border: 4px solid #1e40af;
    object-fit: cover;
}

.staff-card {
    transition: all 0.3s ease;
}

/* ===== TABLE STYLES ===== */
.table-container {
    max-height: 400px;
    overflow-y: auto;
}

.table-container thead th {
    position: sticky;
    top: 0;
    background: white;
    z-index: 10;
}

/* ===== RESPONSIVE IMPROVEMENTS ===== */
@media (max-width: 640px) {
    .kpi-value {
        font-size: 2rem;
    }
    
    .staff-photo {
        width: 100px;
        height: 100px;
    }
}
/* Add these styles for QR scanner */
.waiting {
    animation: breathe 2s infinite ease-in-out;
    border-color: #3b82f6 !important;
}

.scan-success {
    background-color: #f0fdf4 !important;
    border-color: #16a34a !important;
    animation: none !important;
}

.scan-fail {
    background-color: #fef2f2 !important;
    border-color: #dc2626 !important;
    animation: none !important;
}

@keyframes breathe {
    0% { transform: scale(1); box-shadow: 0 0 10px rgba(59, 130, 246, 0.5); }
    50% { transform: scale(1.01); box-shadow: 0 0 20px rgba(59, 130, 246, 0.8); }
    100% { transform: scale(1); box-shadow: 0 0 10px rgba(59, 130, 246, 0.5); }
}
/* Add to your main CSS file */
.btn {
    transition: all 0.2s ease;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background-color: #3b82f6;
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background-color: #2563eb;
}

.btn-success {
    background-color: #10b981;
    color: white;
}

.btn-success:hover:not(:disabled) {
    background-color: #059669;
}

.btn-danger {
    background-color: #ef4444;
    color: white;
}

.btn-danger:hover:not(:disabled) {
    background-color: #dc2626;
}

.btn-secondary {
    background-color: #6b7280;
    color: white;
}

.btn-secondary:hover:not(:disabled) {
    background-color: #4b5563;
}

/* Card styles */
.card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: transform 0.2s ease;
}

.card:hover {
    transform: translateY(-2px);
}
/* Tailwind-friendly report styles */

/* Print styles */
@media print {
    @page {
        margin: 0.5in;
    }
    
    body {
        font-size: 12pt !important;
        line-height: 1.4 !important;
        color: #000 !important;
        background: #fff !important;
    }
    
    .print\:hidden {
        display: none !important;
    }
    
    .container {
        max-width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    
    .shadow-lg, .shadow-xl {
        box-shadow: none !important;
    }
    
    .rounded-xl, .rounded-lg {
        border-radius: 0 !important;
    }
    
    table {
        width: 100% !important;
        border-collapse: collapse !important;
    }
    
    th, td {
        border: 1px solid #ddd !important;
        padding: 6px 8px !important;
    }
    
    thead {
        background-color: #f9fafb !important;
    }
    
    /* Status badges for print */
    .bg-green-100, .bg-yellow-100, .bg-red-100 {
        background-color: transparent !important;
    }
    
    span[class*="bg-"]:not(.bg-white):not(.bg-transparent) {
        background-color: transparent !important;
        border: 1px solid #000 !important;
        color: #000 !important;
    }
}

/* Loading animation */
.animate-spin {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Status badge styling */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.badge-present {
    background-color: #10b981;
    color: white;
}

.badge-late {
    background-color: #f59e0b;
    color: #1f2937;
}

.badge-absent {
    background-color: #ef4444;
    color: white;
}

/* Table hover effects */
tbody tr {
    transition: background-color 0.2s;
}

tbody tr:hover {
    background-color: #f9fafb;
}

/* Card hover effects */
.hover\:shadow-xl {
    transition: box-shadow 0.3s ease;
}

/* Smooth transitions */
.transition-shadow {
    transition-property: box-shadow;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 300ms;
}

.transition-colors {
    transition-property: background-color, border-color, color, fill, stroke;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 300ms;
}

/* Enhanced Print Styles */
@media print {
    @page {
        margin: 0.5in;
        size: letter;
    }
    
    body {
        font-size: 11pt !important;
        line-height: 1.3 !important;
        color: #000 !important;
        background: #fff !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
    
    /* Hide non-print elements */
    .print\:hidden,
    button,
    #refreshBtn,
    #exportBtn,
    #printBtn,
    nav,
    header,
    footer,
    .no-print {
        display: none !important;
    }
    
    /* Show only print content */
    .print-section {
        display: block !important;
        width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    
    /* Remove shadows and borders */
    .shadow,
    .shadow-lg,
    .shadow-md,
    .shadow-sm {
        box-shadow: none !important;
    }
    
    /* Simplify cards */
    .bg-white {
        background-color: transparent !important;
    }
    
    /* Table styling for print */
    table {
        width: 100% !important;
        border-collapse: collapse !important;
        font-size: 9pt !important;
    }
    
    th, td {
        border: 1px solid #ddd !important;
        padding: 4px 6px !important;
        page-break-inside: avoid !important;
    }
    
    th {
        background-color: #f8f9fa !important;
        color: #000 !important;
        font-weight: 600 !important;
    }
    
    /* Status badges for print */
    .badge-present,
    .badge-late,
    .badge-absent {
        background-color: transparent !important;
        color: #000 !important;
        border: 1px solid #000 !important;
        padding: 1px 4px !important;
        border-radius: 2px !important;
        font-size: 8pt !important;
    }
    
    /* Remove background colors */
    .bg-blue-100,
    .bg-green-100,
    .bg-yellow-100,
    .bg-red-100,
    .bg-gray-50,
    .bg-gray-100 {
        background-color: transparent !important;
    }
    
    /* Keep text colors */
    .text-blue-500,
    .text-green-500,
    .text-yellow-500,
    .text-red-500 {
        color: #000 !important;
    }
    
    /* Remove rounded corners */
    .rounded-lg,
    .rounded-xl,
    .rounded {
        border-radius: 0 !important;
    }
    
    /* Keep border colors for cards */
    .border-l-4 {
        border-left-width: 2px !important;
    }
    
    /* Hide watermarks and other decorative elements */
    .fixed,
    .absolute {
        position: static !important;
    }
    
    /* Ensure proper page breaks */
    .break-inside-avoid {
        page-break-inside: avoid !important;
    }
    
    /* Summary cards in print */
    .grid {
        display: grid !important;
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 8px !important;
        margin-bottom: 16px !important;
    }
    
    .p-4 {
        padding: 8px !important;
    }
    
    .text-2xl {
        font-size: 14pt !important;
    }
    
    .text-xs {
        font-size: 7pt !important;
    }
}


/* Date Range Picker Styles */
.date-preset.active {
    background-color: #3b82f6;
    color: white;
    border-color: #3b82f6;
}

.date-preset:hover:not(.active) {
    background-color: #f9fafb;
}

/* Date input styling */
input[type="date"] {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-color: white;
}

input[type="date"]::-webkit-calendar-picker-indicator {
    opacity: 0;
    position: absolute;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

/* Print styles for date range */
@media print {
    .date-range-container {
        display: none !important;
    }
}