/* css/style.css */

/* =========================================
   1. GLOBAL STYLES & RESET
   ========================================= */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8fafc;
    margin: 0;
    padding: 0;
    color: #334155;
}

h2, h3, h4 { color: #0f172a; margin-top: 0; }
a { text-decoration: none; }

/* Buttons */
button, .btn {
    background-color: #3b82f6; color: white; border: none; padding: 10px 15px;
    border-radius: 6px; cursor: pointer; font-size: 14px; font-weight: bold;
    transition: all 0.2s ease; display: inline-flex; align-items: center; justify-content: center;
}
button:hover, .btn:hover { background-color: #2563eb; transform: translateY(-1px); }
button:disabled { background-color: #cbd5e1; cursor: not-allowed; transform: none; }

.btn-danger { background-color: #ef4444; }
.btn-danger:hover { background-color: #dc2626; }
.btn-success { background-color: #10b981; }
.btn-success:hover { background-color: #059669; }
.btn-warning { background-color: #f59e0b; }
.btn-warning:hover { background-color: #d97706; }
.btn-small { padding: 6px 12px; font-size: 12px; }

/* Alerts */
.success-msg { background: #dcfce7; color: #166534; padding: 12px 20px; border-radius: 6px; margin-bottom: 20px; border-left: 4px solid #22c55e; }
.error-msg { background: #fee2e2; color: #991b1b; padding: 12px 20px; border-radius: 6px; margin-bottom: 20px; border-left: 4px solid #ef4444; }

/* =========================================
   2. LAYOUT & NAVIGATION
   ========================================= */
.dashboard-header {
    display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 15px;
    background: #1e293b; color: white; padding: 15px 30px; box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}
.dashboard-header h2 { color: white; margin: 0; font-size: 20px; }
.content-wrapper { max-width: 1200px; margin: 40px auto; padding: 0 20px; }

.btn-logout { background: #475569; color: white; padding: 8px 15px; border-radius: 6px; font-weight: bold; font-size: 13px; }
.btn-logout:hover { background: #334155; }

/* =========================================
   3. TABLES, DATA CARDS & ADMIN GRIDS
   ========================================= */
/* Admin Facility Cards */
.grid-3 { 
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); 
    gap: 20px; 
    margin-bottom: 30px; 
}
.facility-card { 
    background: white; padding: 25px; border-radius: 10px; border: 1px solid #e2e8f0; 
    text-align: center; box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05); 
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex; flex-direction: column; justify-content: space-between;
    align-items: center; /* Added to keep everything centered */
}
.facility-card:hover { 
    transform: translateY(-3px); 
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1); 
}
.facility-card h3 { color: #0f172a; margin-bottom: 10px; font-size: 20px; }
.facility-card p { color: #64748b; margin-bottom: 20px; font-weight: 500; }
.facility-card .btn { margin-top: auto; } /* Removed width: 100% so it fits naturally */

/* Tables */
.table-wrapper { 
    background: white; border-radius: 10px; box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05); 
    overflow-x: auto; border: 1px solid #e2e8f0; margin-bottom: 30px; 
}
table { width: 100%; border-collapse: collapse; min-width: 600px; }
th { background: #f8fafc; color: #64748b; font-weight: 700; font-size: 11px; letter-spacing: 0.5px; padding: 15px; border-bottom: 2px solid #e2e8f0; text-align: left; text-transform: uppercase; }
td { padding: 15px; border-bottom: 1px solid #e2e8f0; color: #334155; vertical-align: middle; font-size: 14px; }
tr:last-child td { border-bottom: none; }
tr:hover { background-color: #f8fafc; }

/* Badges & Pills */
.time-badge { display: inline-block; padding: 5px 10px; border-radius: 6px; font-weight: 600; font-size: 13px; background: #f1f5f9; color: #64748b; }
.time-badge.green { background: #dcfce7; color: #166534; }
.time-badge.orange { background: #ffedd5; color: #9a3412; }
.time-badge.blue { background: #dbeafe; color: #1e40af; }
.time-badge.red { background: #fee2e2; color: #991b1b; }

.status-pill { padding: 6px 12px; border-radius: 20px; font-size: 11px; font-weight: 700; letter-spacing: 0.5px; display: inline-block; white-space: nowrap; }
.pill-ended { background: #e2e8f0; color: #475569; }
.pill-lunch { background: #fef08a; color: #854d0e; }
.pill-duty { background: #bbf7d0; color: #166534; }
.pill-pending { background: #f1f5f9; color: #94a3b8; }
.pill-absent { background: #fee2e2; color: #991b1b; }

/* Stats Grid */
.stats-grid { display: flex; gap: 20px; margin-bottom: 30px; flex-wrap: wrap; }
.stat-card { background: white; padding: 20px; border-radius: 8px; border: 1px solid #e2e8f0; flex: 1; min-width: 200px; text-align: center; box-shadow: 0 2px 4px rgba(0,0,0,0.02); }
.stat-card h3 { color: #64748b; font-size: 12px; text-transform: uppercase; margin-bottom: 10px; letter-spacing: 0.5px; }
.stat-card .number { font-size: 32px; font-weight: 800; color: #0f172a; line-height: 1; }

/* =========================================
   4. MODALS & FORMS
   ========================================= */
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(15, 23, 42, 0.7); display: flex; justify-content: center; align-items: center; z-index: 1000; padding: 20px; box-sizing: border-box; }
.modal-card { background: white; padding: 30px; border-radius: 10px; width: 100%; max-width: 450px; box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1); animation: slideUp 0.3s ease-out; }
.modal-card label { display: block; margin-bottom: 6px; font-weight: 600; color: #475569; font-size: 13px; }
.modal-card input, .modal-card select { width: 100%; padding: 10px 12px; border: 1px solid #cbd5e1; border-radius: 6px; box-sizing: border-box; margin-bottom: 15px; font-size: 14px; transition: border-color 0.2s; }
.modal-card input:focus, .modal-card select:focus { border-color: #3b82f6; outline: none; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 10px; }

@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

/* =========================================
   5. UTILITIES & PRINTING
   ========================================= */
@media print {
    body { background: white; }
    .no-print, .dashboard-header { display: none !important; }
    .content-wrapper { padding: 0; margin: 0; max-width: 100%; }
    .table-wrapper { box-shadow: none; border: 1px solid #000; }
    th, td { border: 1px solid #000; color: #000; }
    .time-badge, .status-pill { background: transparent !important; color: #000 !important; padding: 0; border: none; }
}

/* =========================================
   6. STAFF DASHBOARD SPECIFIC
   ========================================= */
.dashboard-container { 
    max-width: 800px; margin: 50px auto; background: white; padding: 40px; 
    border-radius: 12px; box-shadow: 0 10px 25px -5px rgba(0,0,0,0.1); text-align: center; 
}
.header-info { text-align: left; margin-bottom: 30px; }
.header-info h2 { margin-bottom: 5px; color: #0f172a; font-size: 28px; }
.header-info p { margin-top: 0; color: #64748b; font-size: 16px; font-weight: 500; }

.timer-display { background: #1e293b; color: white; padding: 30px; border-radius: 10px; margin: 30px 0; box-shadow: inset 0 2px 4px rgba(0,0,0,0.2); }
.timer-display h3 { color: #94a3b8; font-size: 14px; margin: 0 0 10px 0; text-transform: uppercase; letter-spacing: 1px; }
.timer-display h1 { font-size: 64px; margin: 0; font-family: monospace; letter-spacing: 2px; text-shadow: 0 2px 4px rgba(0,0,0,0.3); }

.action-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; margin-top: 20px; }
.action-buttons button { padding: 18px; font-size: 16px; width: 100%; border-radius: 8px; box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1); }

#btn-clock-in { background-color: #10b981; }
#btn-clock-in:hover:not(:disabled) { background-color: #059669; }
#btn-lunch-out { background-color: #f59e0b; }
#btn-lunch-out:hover:not(:disabled) { background-color: #d97706; }
#btn-lunch-in { background-color: #3b82f6; }
#btn-lunch-in:hover:not(:disabled) { background-color: #2563eb; }
#btn-clock-out { background-color: #64748b; }
#btn-clock-out:hover:not(:disabled) { background-color: #475569; }

.logout-container { margin-top: 40px; padding-top: 25px; border-top: 2px solid #e2e8f0; text-align: right; }
.btn-logout-staff { display: inline-flex; align-items: center; justify-content: center; background-color: transparent; color: #ef4444; border: 2px solid #ef4444; padding: 10px 24px; border-radius: 6px; text-decoration: none; font-weight: bold; font-size: 15px; transition: all 0.2s ease; }
.btn-logout-staff:hover { background-color: #ef4444; color: white; box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2); transform: translateY(-2px); }
.btn-logout-staff svg { margin-right: 8px; transition: transform 0.2s ease; }
.btn-logout-staff:hover svg { transform: translateX(3px); }

@media (max-width: 600px) {
    .action-buttons { grid-template-columns: 1fr; }
    .dashboard-container { padding: 25px; margin: 20px; }
    .timer-display h1 { font-size: 48px; }
    .header-info h2 { font-size: 24px; }
}

/* =========================================
   7. LOGIN PAGE SPECIFIC
   ========================================= */
.login-wrapper { display: flex; align-items: center; justify-content: center; min-height: 100vh; background-color: #f8fafc; }
.login-container { width: 100%; max-width: 400px; background: white; padding: 40px; border-radius: 12px; box-shadow: 0 10px 25px -5px rgba(0,0,0,0.1); text-align: center; border: 1px solid #e2e8f0; }
.login-container h2 { margin-bottom: 25px; color: #0f172a; font-size: 28px; }
.login-container .form-group { margin-bottom: 20px; text-align: left; }
.login-container label { display: block; margin-bottom: 8px; font-weight: 600; color: #475569; font-size: 14px; }
.login-container input { width: 100%; padding: 12px; border: 1px solid #cbd5e1; border-radius: 6px; box-sizing: border-box; font-size: 15px; transition: border-color 0.2s; }
.login-container input:focus { border-color: #3b82f6; outline: none; }
.login-container button { width: 100%; padding: 14px; font-size: 16px; margin-top: 10px; }