/* Modern Dashboard - Inspired by DreamsLTE SmartHR */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #00a8a8;
    --primary-dark: #008c8c;
    --primary-light: #e6f7f7;
    --secondary-color: #2c3e50;
    --accent-color: #3498db;
    --success-color: #28c76f;
    --danger-color: #ea5455;
    --warning-color: #ff9f43;
    --info-color: #00cfe8;
    --light-gray: #f8f9fa;
    --dark-gray: #6c757d;
    --border-color: #e9ecef;
    --sidebar-width: 240px;
    --header-height: 70px;
    --gradient-primary: linear-gradient(135deg, #00a8a8 0%, #3498db 100%);
}

body {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f5f7fa;
    color: #3e4954;
    font-size: 14px;
    line-height: 1.6;
}

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

.sidebar-logo {
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-logo img {
    max-width: 150px;
    height: auto;
}

.sidebar-menu {
    padding: 20px 0;
}

.menu-item {
    padding: 12px 25px;
    color: rgba(255, 255, 255, 0.7);
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    font-size: 14px;
}

.menu-item:hover,
.menu-item.active {
    background: rgba(0, 168, 168, 0.1);
    color: var(--primary-color);
    border-left: 3px solid var(--primary-color);
}

.menu-item i {
    font-size: 18px;
    width: 20px;
}

.menu-title {
    padding: 20px 25px 10px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

/* Header */
.main-header {
    position: fixed;
    left: var(--sidebar-width);
    right: 0;
    top: 0;
    height: var(--header-height);
    background: white;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    z-index: 999;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.header-left h2 {
    font-size: 24px;
    font-weight: 600;
    color: var(--secondary-color);
}

.header-left p {
    font-size: 13px;
    color: var(--dark-gray);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.header-icon {
    position: relative;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--light-gray);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.header-icon:hover {
    background: var(--primary-color);
    color: white;
}

.header-icon .badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--danger-color);
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 15px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.logout-btn {
    background: var(--danger-color);
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.logout-btn:hover {
    background: #d93f40;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(234, 84, 85, 0.4);
}

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

.user-info h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--secondary-color);
}

.user-info p {
    font-size: 12px;
    color: var(--dark-gray);
}

/* Main Content */
.main-content {
    margin-left: var(--sidebar-width);
    margin-top: var(--header-height);
    padding: 30px;
    min-height: calc(100vh - var(--header-height));
}

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

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    border-left: 4px solid var(--primary-color);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
}

.stat-card.blue { border-left-color: var(--info-color); }
.stat-card.green { border-left-color: var(--success-color); }
.stat-card.orange { border-left-color: var(--warning-color); }
.stat-card.red { border-left-color: var(--danger-color); }

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

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    background: var(--gradient-primary);
    color: white;
}

.stat-card.blue .stat-icon {
    background: linear-gradient(135deg, var(--info-color), #5ae4ff);
}

.stat-card.green .stat-icon {
    background: linear-gradient(135deg, var(--success-color), #5ae49f);
}

.stat-card.orange .stat-icon {
    background: linear-gradient(135deg, var(--warning-color), #ffb873);
}

.stat-card.red .stat-icon {
    background: linear-gradient(135deg, var(--danger-color), #ff7c7c);
}

.stat-number {
    font-size: 32px;
    font-weight: 700;
    color: var(--secondary-color);
    margin-bottom: 5px;
}

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

.stat-change {
    font-size: 12px;
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.stat-change.up {
    color: var(--success-color);
}

.stat-change.down {
    color: var(--danger-color);
}

/* Content Sections */
.content-section {
    background: white;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

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

.section-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--secondary-color);
}

/* Buttons */
button, .btn {
    padding: 10px 20px;
    border-radius: 8px;
    border: none;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

button:hover, .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-secondary {
    background: var(--light-gray);
    color: var(--secondary-color);
}

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

/* Tables */
table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 10px;
}

thead th {
    background: var(--primary-light);
    padding: 15px;
    text-align: left;
    font-weight: 600;
    color: var(--secondary-color);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

tbody tr {
    background: white;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

tbody tr:hover {
    transform: translateX(5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

tbody td {
    padding: 15px;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

tbody td:first-child {
    border-left: 1px solid var(--border-color);
    border-top-left-radius: 8px;
    border-bottom-left-radius: 8px;
}

tbody td:last-child {
    border-right: 1px solid var(--border-color);
    border-top-right-radius: 8px;
    border-bottom-right-radius: 8px;
}

/* Badges */
.badge {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
}

.badge.present, .badge.approved {
    background: rgba(40, 199, 111, 0.1);
    color: var(--success-color);
}

.badge.absent, .badge.rejected {
    background: rgba(234, 84, 85, 0.1);
    color: var(--danger-color);
}

.badge.pending {
    background: rgba(255, 159, 67, 0.1);
    color: var(--warning-color);
}

.badge.holiday {
    background: rgba(0, 207, 232, 0.1);
    color: var(--info-color);
}

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

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

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 168, 168, 0.15);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 16px;
    padding: 30px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease;
}

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

.modal-content h2 {
    margin-bottom: 25px;
    color: var(--secondary-color);
    font-size: 22px;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.active {
        transform: translateX(0);
    }

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

    .stats-grid {
        grid-template-columns: 1fr;
    }
}

/* Hidden class */
.hidden {
    display: none !important;
}

/* Utility classes */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-20 { margin-top: 20px; }
.mb-20 { margin-bottom: 20px; }
.p-20 { padding: 20px; }

/* Theme Toggle Cards */
.theme-option {
    cursor: pointer;
    flex: 1;
    max-width: 200px;
}

.theme-option input[type="radio"] {
    display: none;
}

.theme-card {
    padding: 25px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    text-align: center;
    transition: all 0.3s ease;
    background: white;
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
}

.theme-option:hover .theme-card {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 168, 168, 0.2);
}

.theme-option input[type="radio"]:checked + .theme-card {
    border-color: var(--primary-color);
    background: var(--primary-light);
    box-shadow: 0 4px 12px rgba(0, 168, 168, 0.3);
}

.theme-card span {
    font-weight: 500;
    color: #3e4954;
}

/* Dark Theme Styles */
body.dark-theme {
    background: #0f0c29;
    color: #e4e4e4;
}

body.dark-theme .sidebar {
    background: linear-gradient(180deg, #1a1a2e 0%, #16213e 100%);
    border-right: 1px solid rgba(255, 255, 255, 0.05);
}

body.dark-theme .main-header {
    background: rgba(26, 26, 46, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

body.dark-theme .main-content {
    background: transparent;
}

body.dark-theme .content-section {
    background: rgba(26, 26, 46, 0.6);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

body.dark-theme .stat-card {
    background: rgba(26, 26, 46, 0.8);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

body.dark-theme .stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(0, 168, 168, 0.3);
}

body.dark-theme .stat-number {
    color: #ffffff;
}

body.dark-theme .stat-label {
    color: rgba(255, 255, 255, 0.7);
}

body.dark-theme .settings-section,
body.dark-theme .leave-card,
body.dark-theme .schedule-card {
    background: rgba(26, 26, 46, 0.6);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

body.dark-theme .settings-section h2,
body.dark-theme h1, body.dark-theme h2, body.dark-theme h3 {
    color: #ffffff;
}

body.dark-theme p, body.dark-theme label, body.dark-theme span {
    color: rgba(255, 255, 255, 0.8);
}

body.dark-theme input[type="text"],
body.dark-theme input[type="email"],
body.dark-theme input[type="password"],
body.dark-theme input[type="number"],
body.dark-theme input[type="date"],
body.dark-theme input[type="time"],
body.dark-theme select,
body.dark-theme textarea {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #ffffff;
    backdrop-filter: blur(10px);
}

body.dark-theme input[type="text"]:focus,
body.dark-theme input[type="email"]:focus,
body.dark-theme input[type="password"]:focus,
body.dark-theme input[type="number"]:focus,
body.dark-theme input[type="date"]:focus,
body.dark-theme input[type="time"]:focus,
body.dark-theme select:focus,
body.dark-theme textarea:focus {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--primary-color);
}

body.dark-theme input::placeholder,
body.dark-theme textarea::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

body.dark-theme .theme-card {
    background: rgba(26, 26, 46, 0.6);
    border-color: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

body.dark-theme .theme-card span {
    color: rgba(255, 255, 255, 0.8);
}

body.dark-theme .theme-option input[type="radio"]:checked + .theme-card {
    background: rgba(0, 168, 168, 0.2);
    border-color: var(--primary-color);
}

body.dark-theme .btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

body.dark-theme .btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
}

body.dark-theme table {
    background: rgba(26, 26, 46, 0.4);
    backdrop-filter: blur(10px);
}

body.dark-theme table thead {
    background: rgba(0, 168, 168, 0.3);
}

body.dark-theme table thead th {
    background: transparent;
}

body.dark-theme table th {
    color: #ffffff;
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

body.dark-theme table td {
    color: rgba(255, 255, 255, 0.85);
    border-bottom-color: rgba(255, 255, 255, 0.05);
}

body.dark-theme table tbody tr {
    background: rgba(26, 26, 46, 0.6);
}

body.dark-theme table tbody tr:hover {
    background: rgba(0, 168, 168, 0.2);
}

body.dark-theme .badge {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

body.dark-theme .badge-success {
    background: rgba(40, 199, 111, 0.3);
    color: #28c76f;
}

body.dark-theme .badge-danger {
    background: rgba(234, 84, 85, 0.3);
    color: #ea5455;
}

body.dark-theme .badge-warning {
    background: rgba(255, 159, 67, 0.3);
    color: #ff9f43;
}

body.dark-theme .badge-info {
    background: rgba(0, 207, 232, 0.3);
    color: #00cfe8;
}

body.dark-theme .attendance-card {
    background: rgba(26, 26, 46, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

body.dark-theme .attendance-card h3 {
    color: #ffffff;
}

body.dark-theme .user-dropdown {
    background: rgba(26, 26, 46, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

body.dark-theme .user-dropdown a {
    color: rgba(255, 255, 255, 0.8);
}

body.dark-theme .user-dropdown a:hover {
    background: rgba(0, 168, 168, 0.2);
    color: #ffffff;
}

body.dark-theme .logout-btn {
    background: rgba(234, 84, 85, 0.8);
    color: #ffffff;
}

body.dark-theme .logout-btn:hover {
    background: rgba(234, 84, 85, 1);
    box-shadow: 0 4px 12px rgba(234, 84, 85, 0.5);
}

body.dark-theme .employee-card {
    background: rgba(26, 26, 46, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

body.dark-theme .employee-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 8px 24px rgba(0, 168, 168, 0.3);
}

body.dark-theme .modal {
    background: rgba(15, 12, 41, 0.9);
}

body.dark-theme .modal-content {
    background: rgba(26, 26, 46, 0.95);
    backdrop-filter: blur(30px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

body.dark-theme .modal-header {
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

body.dark-theme .modal-header h2 {
    color: #ffffff;
}

body.dark-theme #mainApp {
    background: #0f0c29;
    color: #e4e4e4;
}



body.dark-theme .close-modal {
    color: rgba(255, 255, 255, 0.7);
}

body.dark-theme .close-modal:hover {
    color: #ffffff;
}

/* Dark theme gradients for stat cards */
body.dark-theme .stat-card.blue .stat-icon {
    background: linear-gradient(135deg, rgba(0, 168, 168, 0.3) 0%, rgba(52, 152, 219, 0.3) 100%);
}

body.dark-theme .stat-card.green .stat-icon {
    background: linear-gradient(135deg, rgba(40, 199, 111, 0.3) 0%, rgba(16, 156, 241, 0.3) 100%);
}

body.dark-theme .stat-card.orange .stat-icon {
    background: linear-gradient(135deg, rgba(255, 159, 67, 0.3) 0%, rgba(255, 107, 43, 0.3) 100%);
}

body.dark-theme .stat-card.red .stat-icon {
    background: linear-gradient(135deg, rgba(234, 84, 85, 0.3) 0%, rgba(244, 67, 54, 0.3) 100%);
}

/* Employee Table Column Alignment Fix - 9 columns (Role and Email removed) */
/* Photo */
#employeesTable tr td:nth-child(1),
#employeesTable thead th:nth-child(1) {
    width: 60px;
    min-width: 60px;
    max-width: 60px;
}

/* Employee ID */
#employeesTable tr td:nth-child(2),
#employeesTable thead th:nth-child(2) {
    width: 100px;
    min-width: 100px;
}

/* Name */
#employeesTable tr td:nth-child(3),
#employeesTable thead th:nth-child(3) {
    width: 180px;
    min-width: 180px;
}

/* Designation */
#employeesTable tr td:nth-child(4),
#employeesTable thead th:nth-child(4) {
    width: 140px;
    min-width: 140px;
}

/* Department */
#employeesTable tr td:nth-child(5),
#employeesTable thead th:nth-child(5) {
    width: 140px;
    min-width: 140px;
}

/* Projects */
#employeesTable tr td:nth-child(6),
#employeesTable thead th:nth-child(6) {
    width: 160px;
    min-width: 160px;
}

/* Status */
#employeesTable tr td:nth-child(7),
#employeesTable thead th:nth-child(7) {
    width: 90px;
    min-width: 90px;
}

/* Device ID */
#employeesTable tr td:nth-child(8),
#employeesTable thead th:nth-child(8) {
    width: 150px;
    min-width: 150px;
    max-width: 170px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Actions */
#employeesTable tr td:nth-child(9),
#employeesTable thead th:nth-child(9) {
    width: 120px;
    min-width: 120px;
    white-space: nowrap;
    text-align: center;
}

/* Make employee table container scrollable if needed */
#employees .tab-content > div {
    overflow-x: auto;
}

#employees table {
    table-layout: fixed;
    width: 100%;
}

/* Icon-only Action Buttons */
.btn-icon {
    width: 32px;
    height: 32px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    margin-right: 4px;
    font-size: 14px;
}

.btn-icon:last-child {
    margin-right: 0;
}

.btn-icon.btn-secondary {
    background: #4299e1;
    color: white;
}

.btn-icon.btn-secondary:hover {
    background: #3182ce;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(66, 153, 225, 0.3);
}

.btn-icon.btn-danger {
    background: #ea5455;
    color: white;
}

.btn-icon.btn-danger:hover {
    background: #dc3545;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(234, 84, 85, 0.3);
}
