@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&display=swap');

:root {
    --primary: #2563eb;
    --primary-light: #dbeafe;
    --primary-dark: #1d4ed8;
    --accent: #8b5cf6;
    --accent-light: #ede9fe;
    --bg-main: #f8fafc;
    --bg-card: #ffffff;
    --sidebar-bg: #0f172a;
    --sidebar-hover: #1e293b;
    --text-primary: #0f172a;
    --text-muted: #64748b;
    --text-white: #ffffff;
    --border-color: #f1f5f9;
    --success: #10b981;
    --success-light: #d1fae5;
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --danger: #ef4444;
    --danger-light: #fee2e2;
    --font-sans: 'Outfit', sans-serif;
    --border-radius: 16px;
    --border-radius-sm: 8px;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.5;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
}

button, input, select, textarea {
    font-family: inherit;
    font-size: inherit;
}

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

/* Sidebar Styles */
.sidebar {
    width: 260px;
    background-color: var(--sidebar-bg);
    color: var(--text-white);
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    z-index: 100;
    transition: var(--transition);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 20px;
    font-weight: 700;
    color: var(--text-white);
    margin-bottom: 32px;
    padding: 0 12px;
}

.sidebar-logo i {
    font-size: 28px;
    color: var(--primary);
}

.sidebar-logo span {
    background: linear-gradient(135deg, #60a5fa, #a78bfa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.menu-section {
    margin-bottom: 24px;
}

.menu-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 12px;
    padding: 0 12px;
    font-weight: 600;
}

.menu-items {
    list-style: none;
}

.menu-item {
    margin-bottom: 4px;
}

.menu-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: var(--border-radius-sm);
    color: #94a3b8;
    font-weight: 500;
    transition: var(--transition);
}

.menu-link i {
    font-size: 20px;
}

.menu-link:hover, .menu-link.active {
    background-color: var(--sidebar-hover);
    color: var(--text-white);
}

.menu-link.active {
    background-color: var(--primary);
    color: var(--text-white);
}

.sidebar-user {
    margin-top: auto;
    background-color: var(--sidebar-hover);
    padding: 12px;
    border-radius: var(--border-radius-sm);
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 16px;
}

.sidebar-user-info {
    flex: 1;
    overflow: hidden;
}

.sidebar-user-name {
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

.sidebar-user-role {
    font-size: 11px;
    color: var(--text-muted);
}

.sidebar-logout {
    color: #ef4444;
    font-size: 20px;
    transition: var(--transition);
    display: flex;
    align-items: center;
}

.sidebar-logout:hover {
    transform: scale(1.1);
}

/* Main Content Layout */
.main-content {
    flex: 1;
    margin-left: 260px;
    padding: 40px;
    min-width: 0;
    transition: var(--transition);
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
}

.page-title h1 {
    font-size: 28px;
    font-weight: 700;
}

.page-title p {
    color: var(--text-muted);
    font-size: 14px;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.datetime-widget {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 8px 16px;
    border-radius: var(--border-radius-sm);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: var(--shadow-sm);
}

/* Dashboard Cards Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.stat-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.stat-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background-color: var(--primary);
    opacity: 0;
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.stat-card:hover::after {
    opacity: 1;
}

.stat-card.success::after { background-color: var(--success); }
.stat-card.warning::after { background-color: var(--warning); }
.stat-card.danger::after { background-color: var(--danger); }
.stat-card.accent::after { background-color: var(--accent); }

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 14px;
    color: var(--text-muted);
    font-weight: 500;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--border-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.stat-card.primary .stat-icon { background-color: var(--primary-light); color: var(--primary); }
.stat-card.success .stat-icon { background-color: var(--success-light); color: var(--success); }
.stat-card.warning .stat-icon { background-color: var(--warning-light); color: var(--warning); }
.stat-card.danger .stat-icon { background-color: var(--danger-light); color: var(--danger); }
.stat-card.accent .stat-icon { background-color: var(--accent-light); color: var(--accent); }

/* Dashboard Content Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
    margin-bottom: 32px;
}

.dashboard-panel {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 24px;
    box-shadow: var(--shadow-sm);
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.panel-title {
    font-size: 18px;
    font-weight: 600;
}

/* Charts and visuals */
.chart-container {
    position: relative;
    height: 300px;
    width: 100%;
}

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

.custom-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.custom-table th {
    background-color: var(--bg-main);
    padding: 14px 16px;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 13px;
    border-bottom: 1px solid var(--border-color);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.custom-table td {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    font-size: 14px;
    color: var(--text-primary);
}

.custom-table tr:last-child td {
    border-bottom: none;
}

.custom-table tbody tr {
    transition: var(--transition);
}

.custom-table tbody tr:hover {
    background-color: var(--bg-main);
}

/* Avatar details in table */
.employee-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

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

.employee-cell-name {
    font-weight: 600;
}

.employee-cell-code {
    font-size: 11px;
    color: var(--text-muted);
}

/* Badges */
.badge {
    display: inline-flex;
    padding: 4px 8px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-success { background-color: var(--success-light); color: var(--success); }
.badge-warning { background-color: var(--warning-light); color: var(--warning); }
.badge-danger { background-color: var(--danger-light); color: var(--danger); }
.badge-primary { background-color: var(--primary-light); color: var(--primary); }

/* Quick Action Widgets */
.clock-widget {
    text-align: center;
    padding: 16px;
    border-radius: var(--border-radius);
    background: linear-gradient(135deg, var(--sidebar-bg), #1e293b);
    color: var(--text-white);
    margin-bottom: 24px;
}

.clock-time {
    font-size: 36px;
    font-weight: 700;
    letter-spacing: 1px;
    margin-bottom: 4px;
}

.clock-date {
    font-size: 13px;
    color: #94a3b8;
    margin-bottom: 20px;
}

.clock-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

/* Button UI */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--border-radius-sm);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    border: none;
    transition: var(--transition);
}

.btn-primary { background-color: var(--primary); color: var(--text-white); }
.btn-primary:hover { background-color: var(--primary-dark); }

.btn-success { background-color: var(--success); color: var(--text-white); }
.btn-success:hover { background-color: #059669; }

.btn-danger { background-color: var(--danger); color: var(--text-white); }
.btn-danger:hover { background-color: #dc2626; }

.btn-outline { background-color: transparent; border: 1px solid var(--border-color); color: var(--text-primary); }
.btn-outline:hover { background-color: var(--bg-main); border-color: var(--text-muted); }

.btn-icon {
    padding: 6px;
    border-radius: var(--border-radius-sm);
    font-size: 16px;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

/* Modal Layout */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
}

.modal-box {
    background-color: var(--bg-card);
    border-radius: var(--border-radius);
    width: 100%;
    max-width: 500px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    transform: scale(0.9);
    opacity: 0;
    transition: var(--transition);
}

.modal-overlay.active {
    display: flex;
}

.modal-overlay.active .modal-box {
    transform: scale(1);
    opacity: 1;
}

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

.modal-title {
    font-size: 18px;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-muted);
}

.modal-body {
    padding: 24px;
}

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

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    border-radius: var(--border-radius-sm);
    border: 1px solid #cbd5e1;
    background-color: var(--bg-card);
    transition: var(--transition);
    outline: none;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* Login Page Styling */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1e3a8a, #7c3aed);
    position: relative;
    padding: 20px;
}

.login-glass-box {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 24px;
    width: 100%;
    max-width: 440px;
    padding: 40px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.login-logo {
    text-align: center;
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 8px;
}

.login-logo i {
    color: var(--primary);
    margin-right: 8px;
}

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

/* Info Messages styling */
.alert-banner {
    padding: 12px 16px;
    border-radius: var(--border-radius-sm);
    font-size: 14px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-banner-danger { background-color: var(--danger-light); color: var(--danger); border: 1px solid rgba(239, 68, 68, 0.2); }
.alert-banner-success { background-color: var(--success-light); color: var(--success); border: 1px solid rgba(16, 185, 129, 0.2); }

/* Holiday list items styling */
.holiday-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.holiday-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px;
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--border-color);
    background-color: var(--bg-card);
}

.holiday-date-badge {
    background-color: var(--primary-light);
    color: var(--primary);
    padding: 8px 12px;
    border-radius: var(--border-radius-sm);
    text-align: center;
    min-width: 60px;
}

.holiday-date-day {
    font-size: 18px;
    font-weight: 700;
    line-height: 1.1;
}

.holiday-date-month {
    font-size: 11px;
    text-transform: uppercase;
    font-weight: 600;
}

.holiday-details {
    flex: 1;
}

.holiday-name {
    font-weight: 600;
    font-size: 15px;
}

.holiday-desc {
    font-size: 12px;
    color: var(--text-muted);
}

/* Printable Payslip Styling */
.payslip-wrapper {
    background: white;
    padding: 40px;
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--border-color);
    color: #1e293b;
    max-width: 800px;
    margin: 0 auto;
}

.payslip-header {
    display: flex;
    justify-content: space-between;
    border-bottom: 2px solid #0f172a;
    padding-bottom: 20px;
    margin-bottom: 24px;
}

.payslip-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary);
}

.payslip-meta {
    font-size: 13px;
    line-height: 1.6;
}

.payslip-emp-info {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px 24px;
    margin-bottom: 32px;
    font-size: 14px;
}

.payslip-breakdown {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    margin-bottom: 32px;
}

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

.payslip-table th {
    text-align: left;
    padding: 8px;
    background-color: #f1f5f9;
    border-bottom: 1px solid #cbd5e1;
    font-size: 13px;
}

.payslip-table td {
    padding: 8px;
    border-bottom: 1px solid #f1f5f9;
    font-size: 13px;
}

.payslip-summary {
    display: flex;
    justify-content: flex-end;
    border-top: 2px solid #cbd5e1;
    padding-top: 16px;
}

.payslip-net {
    font-size: 18px;
    font-weight: 700;
    text-align: right;
}

.payslip-net span {
    color: var(--primary);
}

.print-btn-container {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
}

/* Print CSS Media query */
@media print {
    body * {
        visibility: hidden;
    }
    .payslip-wrapper, .payslip-wrapper * {
        visibility: visible;
    }
    .payslip-wrapper {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        border: none;
        box-shadow: none;
        padding: 0;
    }
    .print-btn-container {
        display: none;
    }
}

/* Responsive CSS */
@media (max-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .sidebar {
        left: -260px;
    }
    .sidebar.active {
        left: 0;
    }
    .main-content {
        margin-left: 0;
        padding: 20px;
    }
    .topbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    .topbar-actions {
        width: 100%;
        justify-content: space-between;
    }
    .form-row {
        grid-template-columns: 1fr;
    }
}
