:root {
    --primary: #2c3e50;
    --secondary: #3498db;
    --accent: #e74c3c;
    --light: #ecf0f1;
    --dark: #2c3e50;
    --success: #2ecc71;
    --warning: #f39c12;
    --danger: #e74c3c;
    --gray: #95a5a6;
    --sidebar-width: 250px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #f5f7f9;
    color: #333;
    display: flex;
    min-height: 100vh;
}

h2 {
    margin-bottom: 20px;
}

/* Sidebar Styles */
.sidebar {
    width: var(--sidebar-width);
    background: var(--primary);
    color: white;
    height: 100vh;
    position: fixed;
    overflow-y: auto;
}

.logo {
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.logo h2 {
    color: white;
    font-size: 1.5rem;
}

.logo span {
    color: var(--secondary);
}

.sidebar-menu {
    padding: 10px 0;
}

.menu-item {
    text-decoration: none;
    color: white;
    display: flex;
    align-items: center;
    padding: 12px 20px;
    border-left: 4px solid transparent;
    transition: all 0.3s;
}

.menu-item:hover {
    background: rgba(255, 255, 255, 0.1);
    border-left: 4px solid var(--secondary);
}

.menu-item.active {
    background: rgba(255, 255, 255, 0.15);
    border-left: 4px solid var(--secondary);
}

.menu-item i {
    margin-right: 10px;
    font-size: 18px;
}

/* Main Content Styles */
.main-content {
    flex: 1;
    margin-left: 120px;
    padding: 50px 20px 20px;
}

.header {
    position: fixed;
    top: 0;
    left: var(--sidebar-width);
    right: 0;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    background: white;
    border-radius: 0;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.user-info {
    display: flex;
    align-items: center;
}

.user-info img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 10px;
}

.dashboard {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.card-header h3 {
    color: var(--primary);
}

.card-header i {
    color: var(--secondary);
    font-size: 20px;
}

.module-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.module-card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s;
    cursor: pointer;
    border-top: 4px solid var(--secondary);
}

.module-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.module-card i {
    font-size: 24px;
    color: var(--secondary);
    margin-bottom: 10px;
}

.module-card h3 {
    color: var(--primary);
    margin-bottom: 10px;
}

.module-card p {
    color: var(--gray);
    font-size: 14px;
}

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.stat-card i {
    font-size: 30px;
    margin-bottom: 10px;
    color: var(--secondary);
}

.stat-card h2 {
    font-size: 28px;
    color: var(--primary);
    margin-bottom: 5px;
}

.stat-card p {
    color: var(--gray);
}

.connections {
    margin-top: 30px;
}

.connection-map {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    overflow: auto;
}

.connection-map img {
    max-width: 100%;
    height: auto;
}

/* Common Module Styles */
.module-tabs {
    display: flex;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 20px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.tab {
    padding: 15px 20px;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
    flex: 1;
    border-bottom: 3px solid transparent;
}

.tab:hover {
    background: #f9f9f9;
}

.tab.active {
    border-bottom: 3px solid var(--secondary);
    font-weight: 500;
}

.tab-content {
    display: none;
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.tab-content.active {
    display: block;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: var(--dark);
}

.form-group input, 
.form-group select, 
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

.form-group textarea {
    min-height: 100px;
    resize: vertical;
}

.btn {
    padding: 10px 20px;
    background: var(--secondary);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s;
}

.btn:hover {
    background: #2980b9;
}

.btn-secondary {
    background: var(--gray);
}

.btn-secondary:hover {
    background: #7f8c8d;
}

.btn-success {
    background: var(--success);
}

.btn-success:hover {
    background: #27ae60;
}

.btn-warning {
    background: var(--warning);
}

.btn-warning:hover {
    background: #e67e22;
}

.btn-danger {
    background: var(--danger);
}

.btn-danger:hover {
    background: #c0392b;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0;
}

th, td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

th {
    background-color: #f2f2f2;
    font-weight: 600;
}

tr:hover {
    background-color: #f9f9f9;
}

.action-buttons {
    display: flex;
    gap: 10px;
}

.action-btn {
    padding: 5px 10px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.edit-btn {
    background: var(--secondary);
    color: white;
}

.delete-btn {
    background: var(--danger);
    color: white;
}

.view-btn {
    background: var(--success);
    color: white;
}

.status-badge {
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

/* Status Variants */
.status-pending {
    background: #ffeaa7;
    color: #d35400;
}

.status-approved {
    background: #d1f7c4;
    color: #27ae60;
}

.status-rejected {
    background: #ffd1d1;
    color: #e74c3c;
}

.status-paid {
    background: #c4e2f7;
    color: #2980b9;
}

.status-overdue {
    background: #ffd1d1;
    color: #e74c3c;
}

.status-active {
    background: #d1f7c4;
    color: #27ae60;
}

.status-inactive {
    background: #ffd1d1;
    color: #e74c3c;
}

.status-present {
    background: #d1f7c4;
    color: #27ae60;
}

.status-absent {
    background: #ffd1d1;
    color: #e74c3c;
}

.status-halfday {
    background: #ffeaa7;
    color: #d35400;
}

.status-available {
    background: #d1f7c4;
    color: #27ae60;
}

.status-inuse {
    background: #c4e2f7;
    color: #2980b9;
}

.status-maintenance {
    background: #ffeaa7;
    color: #d35400;
}

.status-broken {
    background: #ffd1d1;
    color: #e74c3c;
}

.status-retired {
    background: #e0e0e0;
    color: #7f8c8d;
}

.status-delivered {
    background: #c4e2f7;
    color: #2980b9;
}

.status-draft {
    background: #ffeaa7;
    color: #d35400;
}

.status-submitted {
    background: #c4e2f7;
    color: #2980b9;
}

.status-won {
    background: #d1f7c4;
    color: #27ae60;
}

.status-lost {
    background: #ffd1d1;
    color: #e74c3c;
}

.status-completed {
    background: #c4e2f7;
    color: #2980b9;
}

.status-expired {
    background: #ffd1d1;
    color: #e74c3c;
}

.status-normal {
    background: #d1f7c4;
    color: #27ae60;
}

.status-low {
    background: #ffeaa7;
    color: #d35400;
}

.status-critical {
    background: #ffd1d1;
    color: #e74c3c;
}

.status-damaged {
    background: #ffeaa7;
    color: #d35400;
}

.status-processing {
    background: #ffeaa7;
    color: #d35400;
}

.status-profitable {
    background: #d1f7c4;
    color: #27ae60;
}

.status-breakeven {
    background: #ffeaa7;
    color: #d35400;
}

.status-loss {
    background: #ffd1d1;
    color: #e74c3c;
}

.status-ontrack {
    background: #d1f7c4;
    color: #27ae60;
}

.status-delayed {
    background: #ffeaa7;
    color: #d35400;
}

/* Summary Grid */
.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.summary-item {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.summary-item i {
    font-size: 30px;
    margin-bottom: 10px;
    color: var(--secondary);
}

.summary-item h3 {
    font-size: 24px;
    margin-bottom: 5px;
    color: var(--primary);
}

.summary-item p {
    color: var(--gray);
}

/* Progress Bars */
.progress-bar {
    height: 10px;
    background: #eee;
    border-radius: 5px;
    overflow: hidden;
    margin: 10px 0;
}

.progress-fill {
    height: 100%;
    border-radius: 5px;
}

.progress-good {
    background: var(--success);
}

.progress-warning {
    background: var(--warning);
}

.progress-danger {
    background: var(--danger);
}

/* Media Queries */
@media (max-width: 992px) {
    .sidebar {
        width: 70px;
    }

    .sidebar .logo h2,
    .sidebar .menu-item span {
        display: none;
    }

    .sidebar .menu-item {
        justify-content: center;
        padding: 15px;
    }

    .sidebar .menu-item i {
        margin-right: 0;
    }

    .main-content {
        margin-left: 70px;
    }
}

@media (max-width: 768px) {
    .dashboard,
    .stats {
        grid-template-columns: 1fr;
    }

    .module-grid {
        grid-template-columns: 1fr;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .module-tabs {
        flex-wrap: wrap;
    }

    .tab {
        flex: 1 0 33.33%;
    }

    .action-buttons {
        flex-direction: column;
    }

    .summary-grid {
        grid-template-columns: 1fr;
    }
}

/* Specific Module Styles */
.gantt-chart {
    width: 100%;
    overflow-x: auto;
    margin-top: 20px;
}

.gantt-container {
    min-width: 800px;
}

.gantt-row {
    display: flex;
    border-bottom: 1px solid #eee;
    padding: 10px 0;
}

.gantt-row-header {
    width: 200px;
    font-weight: 500;
}

.gantt-bar-container {
    flex: 1;
    position: relative;
    height: 30px;
}

.gantt-bar {
    position: absolute;
    height: 20px;
    background: var(--secondary);
    border-radius: 4px;
    top: 5px;
}

.milestone-marker {
    position: absolute;
    width: 20px;
    height: 20px;
    background: var(--accent);
    border-radius: 50%;
    top: 5px;
    transform: translateX(-50%);
}

.task-list {
    list-style: none;
}

.task-item {
    padding: 10px;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center;
}

.task-item:last-child {
    border-bottom: none;
}

.task-checkbox {
    margin-right: 10px;
}

.inspection-card {
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
}

.inspection-card h4 {
    margin-bottom: 10px;
    color: var(--primary);
}

.delay-analysis {
    background: #fff8e1;
    border-left: 4px solid var(--warning);
    padding: 15px;
    border-radius: 4px;
    margin: 15px 0;
}

.summary-card {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

.summary-row:last-child {
    border-bottom: none;
    font-weight: 600;
    font-size: 1.1em;
}

.resource-card {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
}

.resource-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.supplier-card {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
}

.supplier-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.rating {
    color: #f39c12;
    margin: 5px 0;
}

.stock-card {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
}

.stock-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.alert-badge {
    background: #e74c3c;
    color: white;
    padding: 3px 8px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.attendance-table {
    width: 100%;
    border-collapse: collapse;
}

.attendance-table th, 
.attendance-table td {
    padding: 8px;
    text-align: center;
    border: 1px solid #ddd;
}

.attendance-table th {
    background-color: #f2f2f2;
}

.present-cell {
    background-color: #d1f7c4;
}

.absent-cell {
    background-color: #ffd1d1;
}

.halfday-cell {
    background-color: #ffeaa7;
}

.calendar-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.calendar-nav button {
    background: var(--secondary);
    color: white;
    border: none;
    border-radius: 4px;
    padding: 8px 15px;
    cursor: pointer;
}

.calendar-nav h3 {
    margin: 0;
}

.wage-summary {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
}

.wage-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

.wage-row:last-child {
    border-bottom: none;
    font-weight: 600;
    font-size: 1.1em;
}

.financial-summary {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
}

.financial-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

.financial-row:last-child {
    border-bottom: none;
    font-weight: 600;
    font-size: 1.1em;
}

.income-amount {
    color: var(--success);
}

.expense-amount {
    color: var(--danger);
}

.chart-container {
    height: 300px;
    margin: 20px 0;
    position: relative;
}

.budget-bar {
    height: 20px;
    background: #eee;
    border-radius: 10px;
    margin: 10px 0;
    overflow: hidden;
    position: relative;
}

.budget-fill {
    height: 100%;
    border-radius: 10px;
}

.budget-used {
    background: var(--secondary);
}

.budget-remaining {
    background: var(--success);
}

.budget-over {
    background: var(--danger);
}

.budget-label {
    position: absolute;
    top: 0;
    left: 10px;
    color: white;
    font-weight: 500;
    line-height: 20px;
}

.timeline {
    border-left: 3px solid var(--secondary);
    border-bottom-right-radius: 4px;
    border-top-right-radius: 4px;
    margin: 20px 0;
    padding-left: 25px;
}

.event {
    margin-bottom: 20px;
    position: relative;
}

.event:before {
    content: '';
    position: absolute;
    left: -31px;
    top: 5px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--secondary);
}

.event-date {
    font-weight: 500;
    color: var(--primary);
}

.event-content {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 6px;
    margin-top: 5px;
}

.document-list {
    list-style: none;
}

.document-item {
    padding: 10px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.document-item:last-child {
    border-bottom: none;
}

.document-icon {
    margin-right: 10px;
    color: var(--secondary);
}

.employee-profile {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.employee-photo {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 20px;
    border: 3px solid var(--secondary);
}

.employee-details {
    flex: 1;
}

.attendance-calendar {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
    margin: 15px 0;
}

.calendar-header {
    text-align: center;
    font-weight: 600;
    padding: 10px;
    background: #f2f2f2;
    border-radius: 4px;
}

.calendar-cell {
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    border: 1px solid #eee;
}

.leave-cell {
    background: #c4e2f7;
}

.holiday-cell {
    background: #e0e0e0;
}

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.kpi-item {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
}

.kpi-value {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 5px;
}

.kpi-label {
    color: var(--gray);
    font-size: 14px;
}

.report-filters {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
}

.equipment-card {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
}

.equipment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.maintenance-alert {
    background: #fff8e1;
    border-left: 4px solid var(--warning);
    padding: 15px;
    border-radius: 4px;
    margin: 15px 0;
}

.downtime-tracker {
    background: #ffebee;
    border-left: 4px solid var(--danger);
    padding: 15px;
    border-radius: 4px;
    margin: 15px 0;
}

.calendar {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
    margin: 15px 0;
}

.calendar-cell {
    height: 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    border: 1px solid #eee;
    font-size: 12px;
    text-align: center;
}

.maintenance-day {
    background: #ffeaa7;
}

.downtime-day {
    background: #ffd1d1;
}

.permission-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin: 15px 0;
}

.permission-item {
    background: #f8f9fa;
    border-radius: 6px;
    padding: 15px;
}

.permission-item label {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.permission-item input {
    margin-right: 10px;
}

.user-card {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
}

.user-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.user-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 15px;
}

.user-info {
    display: flex;
    align-items: center;
}

.log-entry {
    border-left: 4px solid var(--secondary);
    padding: 10px 15px;
    margin-bottom: 10px;
    background: #f8f9fa;
    border-radius: 0 4px 4px 0;
}

.log-critical {
    border-left-color: var(--danger);
}

.log-warning {
    border-left-color: var(--warning);
}

.log-info {
    border-left-color: var(--secondary);
}

.search-box {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.search-box input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

/* Mobile specific adjustments */
@media (max-width: 768px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .employee-profile {
        flex-direction: column;
        text-align: center;
    }
    
    .employee-photo {
        margin-right: 0;
        margin-bottom: 15px;
    }
    
    .attendance-calendar,
    .calendar {
        grid-template-columns: repeat(7, 1fr);
        font-size: 12px;
    }
    
    .calendar-cell {
        height: 40px;
        font-size: 10px;
    }
    
    .user-info {
        flex-direction: column;
        text-align: center;
    }
    
    .user-avatar {
        margin-right: 0;
        margin-bottom: 10px;
    }
    
    .permission-grid {
        grid-template-columns: 1fr;
    }
    
    .kpi-grid {
        grid-template-columns: 1fr;
    }
}