/* =====================================================
   Client & Employee Management System - Main Stylesheet
   ===================================================== */

:root {
    --primary: #4361ee;
    --primary-dark: #3a56d4;
    --secondary: #6c757d;
    --success: #2ec4b6;
    --danger: #e71d36;
    --warning: #ff9f1c;
    --info: #4cc9f0;
    --dark: #2b2d42;
    --light: #f8f9fa;
    --sidebar-width: 260px;
    --sidebar-collapsed: 70px;
    --topnavbar-height: 60px;
    --body-bg: #f0f2f5;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--body-bg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* =====================================================
   Login Page
   ===================================================== */
.login-page {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary) 0%, #7209b7 100%);
}

.login-card {
    background: white;
    border-radius: 15px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    overflow: hidden;
    width: 100%;
    max-width: 900px;
}

.login-left {
    background: linear-gradient(135deg, var(--primary) 0%, #7209b7 100%);
    color: white;
    padding: 60px 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.login-left i {
    font-size: 80px;
    margin-bottom: 20px;
}

.login-logo {
    width: 100px;
    height: auto;
    margin-bottom: 20px;
    object-fit: contain;
}

.login-mobile-logo .login-logo {
    width: 80px;
}

.login-left h2 {
    font-size: 28px;
    margin-bottom: 10px;
}

.login-left p {
    opacity: 0.8;
    font-size: 14px;
}

.login-right {
    padding: 60px 40px;
}

.login-right h3 {
    color: var(--dark);
    margin-bottom: 30px;
}

/* =====================================================
   Sidebar
   ===================================================== */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--dark);
    color: white;
    z-index: 1000;
    transition: all 0.3s ease;
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-brand {
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 20px;
    font-weight: 700;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

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

.sidebar-logo {
    width: 36px;
    height: 36px;
    object-fit: contain;
    border-radius: 6px;
}

.sidebar-nav {
    list-style: none;
    padding: 10px 0;
    margin: 0;
}

.sidebar-nav .nav-item {
    margin: 2px 10px;
}

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-size: 14px;
}

.sidebar-nav .nav-link:hover {
    background: rgba(255,255,255,0.1);
    color: white;
}

.sidebar-nav .nav-link.active {
    background: var(--primary);
    color: white;
}

.sidebar-nav .nav-link i {
    width: 20px;
    text-align: center;
}

.sidebar-nav .nav-divider {
    height: 1px;
    background: rgba(255,255,255,0.1);
    margin: 10px 15px;
}

/* =====================================================
   Main Content
   ===================================================== */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    transition: all 0.3s ease;
}

/* =====================================================
   Footer
   ===================================================== */
.app-footer {
    background-color: #f8f9fa;
    border-top: 1px solid #dee2e6;
    padding: 16px 0;
    text-align: center;
    font-size: 14px;
    color: #6c757d;
    margin-left: var(--sidebar-width);
    transition: margin-left 0.3s ease;
}

/* =====================================================
   Top Navbar
   ===================================================== */
.top-navbar {
    background: white;
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
    position: sticky;
    top: 0;
    z-index: 999;
}

.sidebar-toggle {
    font-size: 20px;
    color: var(--dark);
    text-decoration: none;
}

.user-avatar {
    color: var(--primary);
}

/* =====================================================
   Dashboard Cards
   ===================================================== */
.dashboard-card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    transition: transform 0.3s ease;
    border-left: 4px solid var(--primary);
}

.dashboard-card:hover {
    transform: translateY(-5px);
}

.dashboard-card .card-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
}

.dashboard-card .card-info h3 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 5px;
}

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

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

/* =====================================================
   Tables
   ===================================================== */
.data-table {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    overflow: hidden;
}

.data-table .table {
    margin: 0;
}

.data-table .table th {
    background: var(--dark);
    color: white;
    border: none;
    padding: 12px 15px;
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
}

.data-table .table td {
    padding: 12px 15px;
    vertical-align: middle;
    border-color: #eee;
}

.data-table .table tbody tr:hover {
    background: #f8f9fa;
}

/* =====================================================
   Badges
   ===================================================== */
.badge {
    padding: 6px 12px;
    font-weight: 500;
    font-size: 12px;
}

/* =====================================================
   Cards
   ===================================================== */
.card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

.card-header {
    background: white;
    border-bottom: 1px solid #eee;
    padding: 15px 20px;
    font-weight: 600;
}

.card-body {
    padding: 20px;
}

/* =====================================================
   Forms
   ===================================================== */
.form-control, .form-select {
    border-radius: 8px;
    padding: 10px 15px;
    border: 1px solid #ddd;
}

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

.btn {
    border-radius: 8px;
    padding: 10px 20px;
    font-weight: 500;
}

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

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

/* =====================================================
   Charts Container
   ===================================================== */
.chart-container {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

/* =====================================================
   Search & Filter
   ===================================================== */
.search-filter-box {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    margin-bottom: 20px;
}

/* =====================================================
   Responsive
   ===================================================== */
@media (max-width: 768px) {
    .sidebar {
        width: var(--sidebar-collapsed);
    }
    
    .sidebar .sidebar-brand span,
    .sidebar .nav-link span {
        display: none;
    }
    
    .sidebar .sidebar-brand {
        justify-content: center;
        padding: 20px 10px;
    }
    
    .sidebar .nav-link {
        justify-content: center;
        padding: 12px;
    }
    
    .sidebar .nav-link i {
        margin: 0;
    }
    
    .main-content {
        margin-left: var(--sidebar-collapsed);
    }
    
    .app-footer {
        margin-left: var(--sidebar-collapsed);
    }
    
    .login-left {
        display: none;
    }
    
    .login-right {
        padding: 40px 20px;
    }
}

@media (max-width: 576px) {
    .sidebar {
        width: var(--sidebar-width);
        transform: translateX(-100%);
    }

    .sidebar.sidebar-open {
        transform: translateX(0);
    }

    .sidebar.sidebar-open .sidebar-brand span,
    .sidebar.sidebar-open .nav-link span {
        display: inline;
    }

    .sidebar.sidebar-open .sidebar-brand {
        justify-content: flex-start;
        padding: 20px;
    }

    .sidebar.sidebar-open .nav-link {
        justify-content: flex-start;
        padding: 12px 15px;
    }

    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
    }

    .sidebar-overlay.active {
        display: block;
    }

    body.sidebar-open {
        overflow: hidden;
    }

    .main-content {
        margin-left: 0;
    }

    .app-footer {
        margin-left: 0;
    }

    .top-navbar {
        padding: 15px;
    }

    .container-fluid {
        padding: 15px !important;
    }
}

/* =====================================================
   Utility Classes
   ===================================================== */
.text-primary { color: var(--primary) !important; }
.text-success { color: var(--success) !important; }
.text-danger { color: var(--danger) !important; }
.text-warning { color: var(--warning) !important; }

.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 0.25rem !important; }
.mb-2 { margin-bottom: 0.5rem !important; }
.mb-3 { margin-bottom: 1rem !important; }
.mb-4 { margin-bottom: 1.5rem !important; }

.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: 0.25rem !important; }
.mt-2 { margin-top: 0.5rem !important; }
.mt-3 { margin-top: 1rem !important; }
.mt-4 { margin-top: 1.5rem !important; }

/* =====================================================
   Table Action Buttons
   ===================================================== */
.btn-action {
    padding: 5px 10px;
    font-size: 12px;
    border-radius: 6px;
}

/* =====================================================
   Modal Styles
   ===================================================== */
.modal-header {
    background: var(--primary);
    color: white;
}

.modal-header .btn-close {
    filter: brightness(0) invert(1);
}

/* =====================================================
   Upcoming Deadlines
   ===================================================== */
.deadline-item {
    display: flex;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}

.deadline-item:last-child {
    border-bottom: none;
}

.deadline-date {
    width: 60px;
    height: 60px;
    background: var(--danger);
    color: white;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
}

.deadline-date .day {
    font-size: 20px;
    font-weight: 700;
    line-height: 1;
}

.deadline-date .month {
    font-size: 10px;
    text-transform: uppercase;
}

/* =====================================================
   Print Styles
   ===================================================== */
@media print {
    .sidebar, .top-navbar, .btn, .no-print, .app-footer {
        display: none !important;
    }
    
    .main-content {
        margin-left: 0 !important;
    }
}
