/* ============================================
   PAYROLL SYSTEM - MAIN STYLESHEET
   ============================================ */

:root {
    --primary: #4361ee;
    --primary-dark: #3a56d4;
    --secondary: #6c757d;
    --success: #2ec4b6;
    --danger: #e71d36;
    --warning: #ff9f1c;
    --info: #4cc9f0;
    --light: #f8f9fa;
    --dark: #212529;
    --sidebar-bg: #1e293b;
    --sidebar-text: #94a3b8;
    --sidebar-active: #4361ee;
    --body-bg: #f1f5f9;
    --card-bg: #ffffff;
    --text-color: #334155;
    --border-color: #e2e8f0;
}

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

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background-color: var(--body-bg);
    color: var(--text-color);
    font-size: 14px;
    line-height: 1.5;
}

/* Layout */
.app-wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    overflow-y: auto;
    z-index: 1000;
    transition: all 0.3s ease;
}

.sidebar-brand {
    padding: 20px 24px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-brand h4 {
    color: #fff;
    font-size: 18px;
    font-weight: 700;
    margin: 0;
}

.sidebar-brand small {
    color: var(--sidebar-text);
    font-size: 11px;
}

.sidebar-nav {
    padding: 12px 0;
}

.sidebar-nav .nav-section {
    padding: 12px 24px 6px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(148,163,184,0.6);
    font-weight: 600;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    padding: 10px 24px;
    color: var(--sidebar-text);
    text-decoration: none;
    transition: all 0.2s;
    font-size: 13px;
    border-left: 3px solid transparent;
}

.sidebar-nav a:hover {
    background: rgba(255,255,255,0.05);
    color: #fff;
}

.sidebar-nav a.active {
    background: rgba(67,97,238,0.15);
    color: #fff;
    border-left-color: var(--sidebar-active);
}

.sidebar-nav a i {
    width: 20px;
    margin-right: 12px;
    font-size: 16px;
    opacity: 0.8;
}

/* Main Content */
.main-content {
    margin-left: 260px;
    flex: 1;
    min-height: 100vh;
}

/* Topbar */
.topbar {
    background: #fff;
    padding: 12px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 999;
}

.topbar .page-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--dark);
}

.topbar .user-menu {
    display: flex;
    align-items: center;
    gap: 12px;
}

.topbar .user-menu .dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--text-color);
    font-size: 14px;
}

.topbar .user-menu .avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
}

/* Content Area */
.content-area {
    padding: 24px;
}

/* Cards */
.card {
    background: var(--card-bg);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

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

.card-header h5 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.card-body {
    padding: 20px;
}

/* Stats Cards */
.stat-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 20px;
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 16px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #fff;
}

.stat-card .stat-info h3 {
    font-size: 24px;
    font-weight: 700;
    margin: 0;
    color: var(--dark);
}

.stat-card .stat-info p {
    margin: 0;
    color: var(--secondary);
    font-size: 13px;
}

.bg-primary { background: var(--primary); }
.bg-success { background: var(--success); }
.bg-warning { background: var(--warning); }
.bg-danger { background: var(--danger); }
.bg-info { background: var(--info); }
.bg-secondary { background: var(--secondary); }

/* Tables */
.table-container {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th {
    background: #f8fafc;
    padding: 10px 14px;
    text-align: left;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #64748b;
    border-bottom: 2px solid var(--border-color);
}

.table td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-color);
    font-size: 13px;
}

.table tbody tr:hover {
    background: #f8fafc;
}

/* Badges */
.badge-status {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-active, .badge-approved, .badge-present, .badge-paid { background: #dcfce7; color: #166534; }
.badge-inactive, .badge-rejected, .badge-absent { background: #fce7f3; color: #9d174d; }
.badge-pending { background: #fef3c7; color: #92400e; }
.badge-draft { background: #e2e8f0; color: #475569; }
.badge-locked, .badge-processing { background: #dbeafe; color: #1e40af; }
.badge-on-hold, .badge-half-day { background: #fef3c7; color: #92400e; }
.badge-late { background: #fee2e2; color: #991b1b; }
.badge-on-leave, .badge-holiday { background: #e0e7ff; color: #3730a3; }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); color: #fff; }
.btn-success { background: var(--success); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-warning { background: var(--warning); color: #fff; }
.btn-info { background: var(--info); color: #fff; }
.btn-secondary { background: var(--secondary); color: #fff; }
.btn-outline {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-color);
}
.btn-outline:hover { background: #f8fafc; }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-lg { padding: 12px 24px; font-size: 15px; }

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

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    font-size: 13px;
    color: var(--text-color);
}

.form-control {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 13px;
    color: var(--text-color);
    background: #fff;
    transition: border-color 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(67,97,238,0.1);
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 8px center;
    background-repeat: no-repeat;
    background-size: 20px;
    padding-right: 36px;
}

textarea.form-control {
    resize: vertical;
    min-height: 80px;
}

/* Alerts */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.alert-success { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.alert-danger { background: #fce7f3; color: #9d174d; border: 1px solid #fbcfe8; }
.alert-warning { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }
.alert-info { background: #dbeafe; color: #1e40af; border: 1px solid #bfdbfe; }

/* Login Page */
.login-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
}

.login-card {
    background: #fff;
    border-radius: 16px;
    padding: 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.login-card h2 {
    text-align: center;
    margin-bottom: 8px;
    font-size: 24px;
    font-weight: 700;
    color: var(--dark);
}

.login-card .subtitle {
    text-align: center;
    color: var(--secondary);
    margin-bottom: 30px;
    font-size: 14px;
}

.login-card .logo {
    text-align: center;
    margin-bottom: 24px;
}

.login-card .logo i {
    font-size: 48px;
    color: var(--primary);
}

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.page-header h2 {
    font-size: 22px;
    font-weight: 700;
    margin: 0;
}

/* Pagination */
.pagination {
    display: flex;
    gap: 4px;
    justify-content: center;
    margin-top: 20px;
}

.pagination a, .pagination span {
    padding: 6px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    text-decoration: none;
    font-size: 13px;
    color: var(--text-color);
}

.pagination a:hover { background: #f1f5f9; }
.pagination .active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--secondary);
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state h5 {
    color: var(--text-color);
    margin-bottom: 8px;
}

/* Print Styles */
@media print {
    .sidebar, .topbar, .no-print { display: none !important; }
    .main-content { margin-left: 0 !important; }
    .content-area { padding: 0 !important; }
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .main-content {
        margin-left: 0;
    }
    .stat-card {
        flex-direction: column;
        text-align: center;
    }
}

/* Payslip */
.payslip {
    max-width: 800px;
    margin: 0 auto;
    background: #fff;
    padding: 40px;
    border: 1px solid var(--border-color);
}

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

.payslip-table {
    width: 100%;
    border-collapse: collapse;
}

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

.payslip-table .label {
    font-weight: 500;
    color: #64748b;
    width: 40%;
}

.payslip-table .amount {
    text-align: right;
    font-weight: 600;
}

.payslip-section {
    margin: 20px 0;
}

.payslip-section h6 {
    background: #f1f5f9;
    padding: 8px 12px;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.payslip-total {
    border-top: 2px solid var(--dark);
    font-size: 16px;
    font-weight: 700;
}
