/* === MODERN DESIGN (Inter Font & Dark Theme) === */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #0a0e27 0%, #1a1d3a 100%);
    color: #e0e0e0;
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

.hidden { display: none !important; }

/* === HEADER === */
.header {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1.5rem 2rem;
    border-radius: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.header h1 {
    font-size: 1.8rem;
    color: #00d4ff;
    font-weight: 600;
    margin: 0;
}

.header h3 {
    color: #aaa;
    font-size: 0.9rem;
    font-weight: 400;
    margin-top: 0.3rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    text-align: right;
}

.user-info span {
    display: block;
    color: #00d4ff;
    font-size: 0.9rem;
    font-weight: 500;
}

/* === BUTTONS === */
.btn {
    padding: 0.6rem 1.2rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-primary {
    background: linear-gradient(135deg, #00d4ff 0%, #0099cc 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 212, 255, 0.4);
}

.btn-sec {
    background: rgba(255, 255, 255, 0.1);
    color: #e0e0e0;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-sec:hover { background: rgba(255, 255, 255, 0.15); }

.btn-warn {
    background: linear-gradient(135deg, #ff9800 0%, #f57c00 100%);
    color: white;
}

.btn-warn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 152, 0, 0.4);
}

.btn-sm { padding: 0.4rem 0.8rem; font-size: 0.85rem; }

/* === STAT CARDS === */
.dashboard-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1.5rem;
    border-radius: 16px;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

/* Specific colors for specific cards to match your logic */
.stat-card-complete .stat-card-value { color: #2196F3; }
.stat-card-repairing .stat-card-value { color: #ff9800; }
.stat-card-check .stat-card-value { color: #ffc107; }
.stat-card-active .stat-card-value { color: #00ff88; }

.stat-card-icon { font-size: 2.5rem; }
.stat-card-value { font-size: 2rem; font-weight: 700; margin-top: 0.3rem; }
.stat-card-label { font-size: 0.85rem; color: #aaa; text-transform: uppercase; letter-spacing: 0.5px; }

/* === PERFORMANCE CHART SECTION === */
.employee-performance-section {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 2rem;
    border-radius: 16px;
    margin-bottom: 2rem;
}

.performance-chart-container {
    background: rgba(0, 0, 0, 0.2);
    padding: 1.5rem;
    border-radius: 12px;
    margin-top: 1rem;
    height: 350px;
    position: relative;
}

.performance-chart-container canvas {
    max-height: 100%;
}

/* === TABLES === */
table {
    width: 100%;
    border-collapse: collapse;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    overflow: hidden;
    margin-top: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

th, td { padding: 15px; text-align: left; border-bottom: 1px solid rgba(255,255,255,0.1); }
th { background: rgba(0,0,0,0.2); color: #00d4ff; font-weight: 600; }
tr:hover { background: rgba(255,255,255,0.05); cursor: pointer; }

.status-badge {
    display: inline-block;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* === DETAIL VIEW & HISTORY (Modern Timeline) === */
#detailView {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 2rem;
    border-radius: 16px;
    margin-top: 2rem;
}

#detailTitle { font-size: 1.5rem; color: #00d4ff; margin: 0; }

.history-timeline {
    position: relative;
    padding-left: 2rem;
    margin-top: 1.5rem;
}

.history-timeline::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 2px;
    background: linear-gradient(180deg, #00d4ff 0%, rgba(0, 212, 255, 0.1) 100%);
}

.history-item {
    position: relative;
    margin-bottom: 1.5rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 1.2rem;
    transition: all 0.3s ease;
}

.history-item:hover {
    background: rgba(255, 255, 255, 0.06);
    transform: translateX(4px);
}

.history-item::before {
    content: '';
    position: absolute;
    left: -2.1rem; 
    top: 1.5rem;
    width: 12px;
    height: 12px;
    background: #00d4ff;
    border: 3px solid #0a0e27;
    border-radius: 50%;
    box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.3);
}

.history-item.comment::before {
    background: #00ff88;
    box-shadow: 0 0 0 3px rgba(0, 255, 136, 0.3);
}

.history-item.screenshot::before {
    background: #ff9800;
    box-shadow: 0 0 0 3px rgba(255, 152, 0, 0.3);
}

.history-item.status-change::before {
    background: #2196F3;
    box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.3);
}

.history-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    align-items: center;
}

.history-type {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    color: #00ff88;
}

.history-type.comment {
    color: #00ff88;
}

.history-type.screenshot {
    color: #ff9800;
}

.history-type.status-change {
    color: #2196F3;
}

.history-meta {
    font-size: 0.85rem;
    color: #888;
}

.history-user {
    font-weight: 500;
    color: #aaa;
}

.history-time {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.history-content {
    color: #e0e0e0;
    line-height: 1.6;
    font-size: 0.95rem;
}

.history-screenshot {
    margin-top: 1rem;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.history-screenshot img {
    width: 100%;
    max-width: 500px;
    display: block;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.history-screenshot img:hover {
    transform: scale(1.02);
}

.log-img {
    margin-top: 1rem;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    max-width: 400px;
    display: block;
    cursor: pointer;
    transition: transform 0.3s;
}
.log-img:hover { transform: scale(1.02); }

/* === CHIP GRID === */
.chip-container {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    padding: 2rem;
    overflow: auto;
    margin: 1.5rem 0;
    border: 1px solid rgba(255, 255, 255, 0.05);
    min-height: 300px;
    position: relative;
}

.chip {
    position: absolute;
    width: 45px;
    height: 45px;
    background: #1a1d3a;
    border: 1px solid #444;
    border-radius: 6px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 0.8rem;
    user-select: none;
    transition: all 0.2s;
}

.chip:hover { border-color: #fff; transform: scale(1.1); z-index: 10; }
.chip.marked { background: rgba(255, 152, 0, 0.2); border-color: #ff9800; color: #ff9800; }
.chip.replaced { background: rgba(33, 150, 243, 0.2); border-color: #2196F3; color: #2196F3; }
.chip.good { background: rgba(0, 255, 136, 0.2); border-color: #00ff88; color: #00ff88; }

/* === FORMS & MODALS === */
.form-group label { color: #aaa; margin-bottom: 8px; display: block; font-size: 0.9rem; }
.form-group input, .form-group select {
    width: 100%;
    padding: 12px;
    background: rgba(0,0,0,0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
}
.form-group input:focus { border-color: #00d4ff; outline: none; }

.modal {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.8);
    z-index: 2000;
    justify-content: center;
    align-items: center;
}
.modal.active { display: flex; }

.modal-content {
    background: #151932;
    padding: 30px;
    border-radius: 15px;
    width: 450px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
}

/* === CONTEXT MENU === */
#contextMenu {
    display: none;
    position: absolute;
    background: #1a1d3a;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    z-index: 3000;
}
.menu-item { padding: 12px 16px; border-bottom: 1px solid rgba(255,255,255,0.05); color: #fff; cursor: pointer; }
.menu-item:hover { background: rgba(255,255,255,0.05); }