/* ==========================
   TEJO HRMS - Professional UI
========================== */

*{
    margin:0;
    padding:0;
    box-sizing:border-box;
    font-family:'Segoe UI',sans-serif;
}

:root{
    --primary:#2563eb;
    --primary-dark:#1d4ed8;
    --success:#16a34a;
    --warning:#f59e0b;
    --danger:#dc2626;

    --bg:#f4f7fc;
    --card:#ffffff;

    --text:#1f2937;
    --muted:#6b7280;

    --shadow:0 8px 25px rgba(0,0,0,.08);
}

body{
    background:var(--bg);
    color:var(--text);
}

/* ==========================
   Layout
========================== */

.wrapper{
    display:flex;
    min-height:100vh;
}

.sidebar{
    width:260px;
    background:#111827;
    color:#fff;
    padding:25px 0;
    position:fixed;
    left:0;
    top:0;
    bottom:0;
    overflow-y:auto;
}

.sidebar h2{
    text-align:center;
    margin-bottom:30px;
    font-size:22px;
}

.sidebar a{
    display:block;
    color:#d1d5db;
    text-decoration:none;
    padding:14px 25px;
    transition:.3s;
    font-size:15px;
}

.sidebar a:hover{
    background:#1f2937;
    color:#fff;
    border-left:4px solid var(--primary);
}

.main{
    flex:1;
    margin-left:260px;
}

.header{
    background:#fff;
    padding:20px 30px;
    box-shadow:var(--shadow);
    display:flex;
    justify-content:space-between;
    align-items:center;
}

.header h2{
    font-size:24px;
}

.content{
    padding:30px;
}

/* ==========================
   Cards
========================== */

.card{
    background:var(--card);
    border-radius:16px;
    padding:20px;
    box-shadow:var(--shadow);
    margin-bottom:20px;
}

.card h3{
    margin-bottom:10px;
}

/* Dashboard Cards */

.stats-grid{
    display:grid;
    grid-template-columns:repeat(auto-fit,minmax(220px,1fr));
    gap:20px;
    margin-bottom:25px;
}

.stat-card{
    background:#fff;
    border-radius:16px;
    padding:25px;
    box-shadow:var(--shadow);
}

.stat-card h4{
    color:var(--muted);
    margin-bottom:10px;
}

.stat-card h2{
    font-size:34px;
}

/* ==========================
   Buttons
========================== */

.btn{
    background:var(--primary);
    color:#fff;
    border:none;
    padding:10px 18px;
    border-radius:10px;
    cursor:pointer;
    text-decoration:none;
    display:inline-block;
    transition:.3s;
}

.btn:hover{
    background:var(--primary-dark);
}

.btn-success{
    background:var(--success);
}

.btn-danger{
    background:var(--danger);
}

.btn-warning{
    background:var(--warning);
}

/* ==========================
   Forms
========================== */

input,
select,
textarea{
    width:100%;
    padding:12px;
    border:1px solid #d1d5db;
    border-radius:10px;
    outline:none;
    font-size:14px;
}

input:focus,
select:focus,
textarea:focus{
    border-color:var(--primary);
}

label{
    display:block;
    margin-bottom:8px;
    font-weight:600;
}

/* ==========================
   Tables
========================== */

.table{
    width:100%;
    border-collapse:collapse;
    background:#fff;
    border-radius:15px;
    overflow:hidden;
    box-shadow:var(--shadow);
}

.table th{
    background:var(--primary);
    color:#fff;
    text-align:left;
    padding:14px;
}

.table td{
    padding:14px;
    border-bottom:1px solid #eee;
}

.table tr:hover{
    background:#f9fafb;
}

/* ==========================
   Modal
========================== */

.modal{
    position:fixed;
    inset:0;
    background:rgba(0,0,0,.6);
    display:none;
    justify-content:center;
    align-items:center;
    z-index:999;
}

.modal-content{
    background:#fff;
    width:550px;
    max-width:95%;
    padding:25px;
    border-radius:16px;
    box-shadow:var(--shadow);
}

/* ==========================
   Messages
========================== */

.success-box{
    background:#dcfce7;
    color:#166534;
    padding:14px;
    border-radius:10px;
    margin-bottom:15px;
}

.error-box{
    background:#fee2e2;
    color:#991b1b;
    padding:14px;
    border-radius:10px;
    margin-bottom:15px;
}

/* ==========================
   Attendance Calendar
========================== */

.calendar-grid{
    display:grid;
    grid-template-columns:repeat(7,1fr);
    gap:12px;
    margin-top:20px;
}

.calendar-day{
    background:#fff;
    min-height:110px;
    padding:10px;
    border-radius:12px;
    cursor:pointer;
    box-shadow:var(--shadow);
    transition:.2s;
}

.calendar-day:hover{
    transform:translateY(-3px);
}

.day-number{
    font-size:18px;
    font-weight:bold;
    margin-bottom:10px;
}

/* ==========================
   Badges
========================== */

.badge{
    display:inline-block;
    padding:6px 10px;
    border-radius:20px;
    font-size:12px;
    font-weight:600;
}

.badge.present{
    background:#dcfce7;
    color:#166534;
}

.badge.leave{
    background:#fef3c7;
    color:#92400e;
}

.badge.absent{
    background:#fee2e2;
    color:#991b1b;
}

.badge.wfh{
    background:#fed7aa;
    color:#9a3412;
}

/* ==========================
   Day Details
========================== */

#dayDetails{
    background:#fff;
    margin-top:20px;
    padding:20px;
    border-radius:16px;
    box-shadow:var(--shadow);
}

/* ==========================
   Login Page
========================== */

.login-page{
    min-height:100vh;
    display:flex;
    justify-content:center;
    align-items:center;
    background:linear-gradient(
        135deg,
        #0f172a,
        #0f172a
    );
}

.login-box{
    width:420px;
    background:#fff;
    padding:40px;
    border-radius:20px;
    box-shadow:0 20px 40px rgba(0,0,0,.15);
}

.login-box h1{
    text-align:center;
    margin-bottom:10px;
}

.login-box p{
    text-align:center;
    color:var(--muted);
    margin-bottom:25px;
}

/* ==========================
   Responsive
========================== */

@media(max-width:992px){

    .sidebar{
        width:220px;
    }

    .main{
        margin-left:220px;
    }
}

@media(max-width:768px){

    .sidebar{
        position:relative;
        width:100%;
        height:auto;
    }

    .main{
        margin-left:0;
    }

    .wrapper{
        flex-direction:column;
    }

    .calendar-grid{
        grid-template-columns:repeat(2,1fr);
    }
}

/* =========================
   PAYROLL HISTORY PAGE
========================= */

.filter-card{
    background:#ffffff;
    padding:25px;
    border-radius:20px;
    box-shadow:0 10px 30px rgba(0,0,0,0.08);
    margin-bottom:25px;
}

.filter-card h3{
    margin-bottom:20px;
    color:#111827;
    font-size:22px;
}

.filter-form{
    display:flex;
    gap:15px;
    flex-wrap:wrap;
    align-items:end;
}

.filter-form .field{
    flex:1;
    min-width:220px;
}

.filter-form label{
    display:block;
    margin-bottom:8px;
    font-size:13px;
    font-weight:600;
    color:#6b7280;
}

.filter-form select{
    width:100%;
    height:48px;
    border:1px solid #e5e7eb;
    border-radius:12px;
    padding:0 15px;
    background:#fff;
}

.filter-form button{
    height:48px;
    min-width:160px;
}

/* SUMMARY CARDS */

.payroll-stats{
    display:grid;
    grid-template-columns:repeat(auto-fit,minmax(240px,1fr));
    gap:20px;
    margin-bottom:25px;
}

.payroll-stat{
    position:relative;
    overflow:hidden;
    border-radius:22px;
    padding:25px;
    color:#fff;
    box-shadow:0 15px 30px rgba(0,0,0,0.15);
}

.payroll-stat::before{
    content:'';
    position:absolute;
    right:-30px;
    top:-30px;
    width:120px;
    height:120px;
    border-radius:50%;
    background:rgba(255,255,255,.15);
}

.payroll-stat h4{
    margin:0;
    font-size:14px;
    opacity:.9;
    letter-spacing:.5px;
}

.payroll-stat p{
    margin-top:15px;
    font-size:32px;
    font-weight:700;
}

.payroll-stat.records{
    background:linear-gradient(135deg,#3b82f6,#2563eb);
}

.payroll-stat.salary{
    background:linear-gradient(135deg,#10b981,#059669);
}

.payroll-stat.incentive{
    background:linear-gradient(135deg,#8b5cf6,#7c3aed);
}

.payroll-stat.deduction{
    background:linear-gradient(135deg,#ef4444,#dc2626);
}

.holiday-title{
    margin-top:5px;
    font-size:10px;
    font-weight:700;
    color:#dc2626;
    line-height:1.2;
}

.badge.holiday{
    background:#fee2e2;
    color:#b91c1c;
}

.calendar-day:has(.badge.holiday){
    border-left:4px solid #dc2626;
}

.status-card{
background:#fff;
padding:25px;
border-radius:18px;
box-shadow:var(--shadow);
}

.card h2{
margin-bottom:10px;
}

.card p{
margin-bottom:8px;
line-height:1.6;
}


/* ==========================
   EMPLOYEE ATTENDANCE PAGE
========================== */

.calendar-toolbar{
    background:#fff;
    border-radius:20px;
    padding:20px;
    margin-bottom:20px;
    box-shadow:0 10px 30px rgba(0,0,0,.08);
}

.calendar-nav{
    display:flex;
    justify-content:center;
    align-items:center;
    gap:20px;
}

.calendar-title{
    font-size:22px;
    font-weight:700;
    color:#0f172a;
    min-width:220px;
    text-align:center;
}

.calendar-btn{
    width:45px;
    height:45px;
    border:none;
    border-radius:12px;
    background:#2563eb;
    color:#fff;
    cursor:pointer;
    font-size:18px;
    transition:.3s;
}

.calendar-btn:hover{
    transform:translateY(-2px);
}

.attendance-summary{
    display:grid;
    grid-template-columns:
    repeat(auto-fit,minmax(180px,1fr));
    gap:18px;
    margin-bottom:25px;
}

.attendance-card{
    padding:22px;
    border-radius:18px;
    color:#fff;
    text-align:center;
    box-shadow:0 10px 20px rgba(0,0,0,.12);
}

.attendance-card h4{
    margin-bottom:10px;
    font-size:14px;
    opacity:.9;
}

.attendance-card p{
    font-size:32px;
    font-weight:700;
}

.attendance-card.present{
    background:linear-gradient(
    135deg,#10b981,#059669);
}

.attendance-card.leave{
    background:linear-gradient(
    135deg,#f59e0b,#d97706);
}

.attendance-card.wfh{
    background:linear-gradient(
    135deg,#8b5cf6,#7c3aed);
}

.attendance-card.holiday{
    background:linear-gradient(
    135deg,#3b82f6,#2563eb);
}

.calendar-card{
    background:#fff;
    padding:25px;
    border-radius:20px;
    box-shadow:0 10px 30px rgba(0,0,0,.08);
}

.calendar-day{
    border:1px solid #eef2f7;
}

.status-present{
    border-left:5px solid #10b981;
}

.status-leave{
    border-left:5px solid #f59e0b;
}

.status-wfh{
    border-left:5px solid #8b5cf6;
}

.status-holiday{
    border-left:5px solid #2563eb;
}

.status-absent{
    border-left:5px solid #ef4444;
}

