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

html, body {
    overflow-x: hidden;
    max-width: 100vw;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f8f9fa;
    color: #333;
    line-height: 1.6;
}

/* Sidebar Styles */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 250px;
    height: 100vh;
    background: linear-gradient(180deg, #2c3e50 0%, #34495e 100%);
    color: #ecf0f1;
    z-index: 1000;
    transition: width 0.3s ease, transform 0.3s ease;
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar.collapsed {
    width: 80px;
}

.sidebar.collapsed .logo span,
.sidebar.collapsed .user-info,
.sidebar.collapsed .nav-item span {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.sidebar.collapsed .sidebar-header {
    padding: 20px 10px;
    justify-content: center;
    position: relative;
}

.sidebar.collapsed .logo {
    display: none;
}

.sidebar.collapsed .menu-toggle {
    position: static;
    margin: 0 auto;
}

.sidebar.collapsed .user-profile {
    justify-content: center;
    padding: 15px 0;
    margin: 5px 0;
    border-bottom: 1px solid #34495e;
}

.sidebar.collapsed .user-avatar {
    margin-right: 0;
    width: 28px;
    height: 28px;
}

.sidebar.collapsed .user-avatar i {
    font-size: 28px;
}

.sidebar.collapsed .nav-item {
    justify-content: center;
    padding: 10px 0;
    margin: 3px 0;
    position: relative;
    min-height: 42px;
    display: flex;
    align-items: center;
    border-left: none;
}

.sidebar.collapsed .nav-item i {
    margin-right: 0;
}

/* Tooltip for collapsed sidebar */
.sidebar.collapsed .nav-item:hover::after {
    content: attr(data-tooltip);
    position: fixed;
    left: 88px;
    top: 50%;
    transform: translateY(-50%);
    background: #2c3e50;
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 14px;
    white-space: nowrap;
    z-index: 10001;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    opacity: 1;
    visibility: visible;
    pointer-events: none;
}

.sidebar.collapsed .nav-item:hover::before {
    content: '';
    position: fixed;
    left: 80px;
    top: 50%;
    transform: translateY(-50%);
    border: 8px solid transparent;
    border-right-color: #2c3e50;
    z-index: 10001;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid #34495e;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    font-size: 20px;
    font-weight: 600;
}

.logo i {
    margin-right: 10px;
    color: #3498db;
    font-size: 24px;
}

.menu-toggle {
    background: none;
    border: none;
    color: #ecf0f1;
    font-size: 18px;
    cursor: pointer;
    display: block;
    transition: transform 0.3s ease;
}

.menu-toggle:hover {
    transform: scale(1.1);
}

/* User Profile */
.user-profile {
    padding: 20px;
    border-bottom: 1px solid #34495e;
    display: flex;
    align-items: center;
}

.user-avatar {
    margin-right: 15px;
}

.user-avatar i {
    font-size: 36px;
    color: #bdc3c7;
}

.user-info {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.username {
    font-weight: 500;
    font-size: 14px;
}

.user-info i {
    font-size: 12px;
    color: #95a5a6;
    cursor: pointer;
}

/* Sidebar Navigation */
.sidebar-nav {
    padding: 20px 0;
}

.sidebar.collapsed .sidebar-nav {
    padding: 15px 0;
}

.sidebar-nav ul {
    list-style: none;
}

.nav-item {
    padding: 12px 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    border-left: 3px solid transparent;
}

.nav-item:hover {
    background-color: rgba(52, 73, 94, 0.5);
}

.nav-item.active {
    background-color: rgba(52, 152, 219, 0.2);
    border-left-color: #3498db;
}

.nav-item i {
    margin-right: 15px;
    width: 20px;
    font-size: 16px;
}

.nav-item span {
    font-size: 14px;
    font-weight: 400;
}

/* Main Content */
.main-content {
    margin-left: 250px;
    min-height: 100vh;
    transition: margin-left 0.3s ease, width 0.3s ease;
    overflow-x: hidden;
}

.main-content.sidebar-collapsed {
    margin-left: 80px;
}

/* Header */
.header {
    background: #fff;
    padding: 15px 30px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.header-left {
    display: flex;
    align-items: center;
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 20px;
    color: #2c3e50;
    cursor: pointer;
}

.header-right {
    display: flex;
    gap: 15px;
}

.header-btn {
    background: none;
    border: none;
    padding: 10px;
    border-radius: 6px;
    cursor: pointer;
    color: #6c757d;
    transition: all 0.3s ease;
}

.header-btn:hover {
    background-color: #f8f9fa;
    color: #2c3e50;
}

/* Content Area */
.content-area {
    padding: 30px;
    max-width: 100%;
    overflow-x: hidden;
}

.page {
    display: none;
}

.page.active {
    display: block;
}

.breadcrumb {
    margin-bottom: 20px;
    color: #6c757d;
    font-size: 14px;
}

.breadcrumb span {
    margin-right: 5px;
}

.page-title {
    font-size: 32px;
    font-weight: 300;
    margin-bottom: 30px;
    color: #2c3e50;
}

/* Status Cards */
.status-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.status-card {
    border-radius: 6px;
    padding: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    min-height: 140px;
    position: relative;
    overflow: hidden;
}

.welcome-card {
    background: linear-gradient(135deg, #2980b9 0%, #3498db 100%);
    color: white;
}

.balance-card {
    background: linear-gradient(135deg, #8e44ad 0%, #9b59b6 100%);
    color: white;
}

.invoice-card {
    background: linear-gradient(135deg, #3a7bd5 0%, #00d2ff 100%);
    color: white;
}

.status-card h2 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 15px;
    letter-spacing: 0.5px;
}

.card-details p {
    font-size: 14px;
    margin-bottom: 5px;
    opacity: 0.9;
}

.card-btn {
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.3);
    color: white;
    padding: 8px 15px;
    border-radius: 5px;
    font-size: 12px;
    cursor: pointer;
    margin-top: 10px;
    transition: all 0.3s ease;
}

.card-btn:hover {
    background: rgba(255,255,255,0.3);
}

/* Service Cards */
.service-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.service-card {
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    overflow: hidden;
    transition: transform 0.3s ease;
}

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

.service-header {
    padding: 20px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
}

.service-header i {
    font-size: 24px;
    color: #fff;
    margin-right: 15px;
}

.service-header h3 {
    flex: 1;
    font-size: 16px;
    font-weight: 500;
    color: #fff;
}

.status-indicator {
    background: #e9ecef;
    color: #fff;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.status-indicator.active {
    background: #d4edda;
    color: #155724;
}

.service-content {
    padding: 20px;
}

.service-content p {
    margin-bottom: 15px;
    color: #6c757d;
    font-size: 14px;
}

.service-btn {
    background: white;
    border: 1px solid #dee2e6;
    color: #495057;
    padding: 8px 20px;
    border-radius: 5px;
    font-size: 14px;
    cursor: pointer;
    margin-right: 10px;
    margin-bottom: 10px;
    transition: all 0.3s ease;
}

.service-btn:hover {
    border-color: #adb5bd;
    background-color: #f8f9fa;
}

.service-btn.active {
    background: #007bff;
    border-color: #007bff;
    color: white;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #6c757d;
}

.empty-state i {
    font-size: 64px;
    margin-bottom: 20px;
    color: #dee2e6;
}

.empty-state h3 {
    font-size: 24px;
    margin-bottom: 10px;
    color: #495057;
}

.empty-state p {
    font-size: 16px;
    margin-bottom: 30px;
}

.primary-btn {
    background: #007bff;
    border: none;
    color: white;
    padding: 12px 30px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.primary-btn:hover {
    background: #0056b3;
    transform: translateY(-2px);
}

/* Login Styles */
.login-body {
    background: linear-gradient(135deg, #0f2027 0%, #2c5364 100%);
    /* background-image: url("../assets/img/loginbg2.png"); */
    /* background-repeat: no-repeat; 
    background-size: cover;  */
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.login-container {
    width: 100%;
    max-width: 400px;
}

.login-box {
    background: white;
    border-radius: 15px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
    overflow: hidden;
}

.login-header {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white;
    padding: 5px 5px 5px;
    text-align: center;
}

.login-header .logo {
    justify-content: center;
    margin-bottom: 10px;
    font-size: 24px;
}

.login-header .logo i {
    color: #3498db;
    margin-right: 10px;
}

.login-header h2 {
    font-size: 18px;
    font-weight: 300;
    opacity: 0.9;
}

.login-form {
    padding: 40px 30px 30px;
}

.form-group {
    position: relative;
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #2c3e50;
    font-weight: 500;
    font-size: 14px;
}

.form-group input {
    width: 100%;
    padding: 12px 40px 12px 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.form-group i {
    position: absolute;
    right: 15px;
    top: 38px;
    color: #adb5bd;
}

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    font-size: 14px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    color: #6c757d;
}

.checkbox-label input {
    margin-right: 8px;
}

.forgot-password {
    color: #3498db;
    text-decoration: none;
    transition: color 0.3s ease;
}

.forgot-password:hover {
    color: #2980b9;
}

.login-btn {
    width: 100%;
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    border: none;
    color: white;
    padding: 15px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(52, 152, 219, 0.3);
}

.login-btn i {
    margin-right: 10px;
}

.login-footer {
    text-align: center;
    margin-top: 25px;
    color: #6c757d;
    font-size: 14px;
}

.login-footer a {
    color: #3498db;
    text-decoration: none;
}

.error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 15px;
    border-radius: 8px;
    margin: 20px 30px;
    display: flex;
    align-items: center;
}

.error-message i {
    margin-right: 10px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        width: 250px !important; /* Always full width on mobile */
    }
    
    .sidebar.collapsed {
        width: 250px !important;
    }
    
    .sidebar.collapsed .logo span,
    .sidebar.collapsed .user-info,
    .sidebar.collapsed .nav-item span {
        opacity: 1 !important;
        visibility: visible !important;
    }
    
    .sidebar.collapsed .sidebar-header {
        justify-content: space-between !important;
    }
    
    .sidebar.collapsed .user-profile {
        justify-content: flex-start !important;
    }
    
    .sidebar.collapsed .user-avatar {
        margin-right: 15px !important;
    }
    
    .sidebar.collapsed .nav-item {
        justify-content: flex-start !important;
        padding: 12px 20px !important;
    }
    
    .sidebar.collapsed .nav-item i {
        margin-right: 15px !important;
    }
    
    .sidebar.collapsed .nav-item:hover::after,
    .sidebar.collapsed .nav-item:hover::before {
        display: none !important;
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .main-content.sidebar-collapsed {
        margin-left: 0;
    }
    
    .mobile-menu-toggle {
        display: block;
    }
    
    .content-area {
        padding: 20px;
    }
    
    .status-cards {
        grid-template-columns: 1fr;
    }
    
    .service-cards {
        grid-template-columns: 1fr;
    }
    
    .page-title {
        font-size: 24px;
    }
    
    .login-form {
        padding: 30px 20px;
    }
    
    .login-header {
        padding: 30px 20px 20px;
    }
}

@media (max-width: 480px) {
    .header {
        padding: 15px 20px;
    }
    
    .content-area {
        padding: 15px;
    }
    
    .status-card {
        padding: 20px;
    }
    
    .service-header {
        padding: 15px;
    }
    
    .service-content {
        padding: 15px;
    }
}

/* Animation for page transitions */
.page {
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Loading states */
.loading {
    opacity: 0.7;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Page Actions */
.page-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    gap: 20px;
}

.search-container {
    position: relative;
    max-width: 300px;
    flex: 1;
}

.search-input {
    width: 100%;
    padding: 10px 40px 10px 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.search-container i {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #adb5bd;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeInModal 0.3s ease-out;
}

.modal-content {
    background: white;
    border-radius: 15px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    animation: slideInModal 0.3s ease-out;
}

.modal-header {
    padding: 25px 30px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: white;
    border-radius: 15px 15px 0 0;
}

.modal-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 500;
}

.close-modal {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.close-modal:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Employee Form */
.employee-form {
    padding: 30px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-group label {
    margin-bottom: 8px;
    color: #2c3e50;
    font-weight: 500;
    font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 12px 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

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

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
}

.secondary-btn {
    background: white;
    border: 2px solid #e9ecef;
    color: #6c757d;
    padding: 12px 25px;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.secondary-btn:hover {
    border-color: #adb5bd;
    background-color: #f8f9fa;
}

/* Data Table */
.data-table-container {
    background: white;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    margin-bottom: 30px;
}

.table-header {
    padding: 20px 25px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8f9fa;
}

.table-header h3 {
    margin: 0;
    color: #2c3e50;
    font-size: 18px;
    font-weight: 500;
}

.table-info {
    color: #6c757d;
    font-size: 14px;
}

.table-wrapper {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.data-table th {
    background: #f8f9fa;
    padding: 15px 12px;
    text-align: left;
    font-weight: 600;
    color: #2c3e50;
    border-bottom: 2px solid #e9ecef;
    white-space: nowrap;
}

.data-table td {
    padding: 15px 12px;
    border-bottom: 1px solid #e9ecef;
    vertical-align: middle;
}

.data-table tbody tr {
    transition: background-color 0.3s ease;
}

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

.data-table tbody tr:nth-child(even) {
    background-color: rgba(248, 249, 250, 0.5);
}

.data-table tbody tr:nth-child(even):hover {
    background-color: #f8f9fa;
}

/* Action Buttons in Table */
.action-btn {
    background: none;
    border: none;
    padding: 8px;
    border-radius: 6px;
    cursor: pointer;
    margin: 0 3px;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
}

.action-btn:hover {
    transform: translateY(-1px);
}

.action-btn.view {
    color: #3498db;
}

.action-btn.view:hover {
    background: rgba(52, 152, 219, 0.1);
}

.action-btn.edit {
    color: #f39c12;
}

.action-btn.edit:hover {
    background: rgba(243, 156, 18, 0.1);
}

.action-btn.delete {
    color: #e74c3c;
}

.action-btn.delete:hover {
    background: rgba(231, 76, 60, 0.1);
}

/* Employee Badge */
.employee-type-badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
}

.employee-type-badge.full-time {
    background: #d4edda;
    color: #155724;
}

.employee-type-badge.part-time {
    background: #fff3cd;
    color: #856404;
}

.employee-type-badge.contract {
    background: #d1ecf1;
    color: #0c5460;
}

.employee-type-badge.intern {
    background: #f8d7da;
    color: #721c24;
}

/* Modal Animations */
@keyframes fadeInModal {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideInModal {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Responsive Design for Tables */
@media (max-width: 768px) {
    .page-actions {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }
    
    .search-container {
        max-width: none;
    }
    
    .modal-content {
        width: 95%;
        margin: 10px;
    }
    
    .employee-form {
        padding: 20px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .table-wrapper {
        font-size: 12px;
    }
    
    .data-table th,
    .data-table td {
        padding: 10px 8px;
    }
}

@media (max-width: 480px) {
    .modal-header {
        padding: 20px;
    }
    
    .modal-header h3 {
        font-size: 18px;
    }
    
    .employee-form {
        padding: 15px;
    }
    
    .data-table {
        font-size: 12px;
    }
    
    .action-btn {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }
}
