/* ===== CSS Variables ===== */
:root {
    /* Main Colors - Warm orange palette */
    --bg-dark: #1c1712;
    --bg-card: #2a2118;
    --bg-sidebar: #171310;
    --bg-hover: #352a1f;
    
    --text-primary: #faf6f2;
    --text-secondary: #b8a899;
    --text-muted: #8a7968;
    
    /* Accent Colors - Orange-based palette */
    --accent-primary: #ff8c42;
    --accent-light: #ffab73;
    --accent-dark: #e06b10;
    --accent-coral: #ff6b35;
    --accent-teal: #ffb347;
    --accent-gold: #ffd166;
    --accent-purple: #ff9f1c;
    --accent-sage: #fcbf49;
    --accent-blue: #f4a261;
    
    /* Functional Colors */
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.4);
    
    /* Borders */
    --border-color: rgba(255, 140, 66, 0.15);
    
    /* Spacing */
    --sidebar-width: 260px;
}

/* ===== Reset & Base ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Background Pattern */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(ellipse at 10% 20%, rgba(255, 140, 66, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse at 90% 80%, rgba(255, 107, 53, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(255, 159, 28, 0.06) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
}

/* ===== App Container ===== */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* ===== Sidebar ===== */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 24px;
    border-bottom: 1px solid var(--border-color);
}

.logo-icon {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-dark));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: white;
}

.logo-text {
    font-family: 'Playfair Display', serif;
    font-size: 22px;
    font-weight: 600;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-menu {
    flex: 1;
    padding: 20px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 10px;
    transition: all 0.2s ease;
    font-size: 15px;
    font-weight: 500;
}

.nav-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.nav-item.active {
    background: linear-gradient(135deg, rgba(255, 140, 66, 0.2), rgba(255, 107, 53, 0.15));
    color: var(--text-primary);
    border: 1px solid rgba(255, 140, 66, 0.3);
}

.nav-item.active i {
    color: var(--accent-primary);
}

.nav-item i {
    width: 20px;
    text-align: center;
    font-size: 16px;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid var(--border-color);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-hover);
    border-radius: 12px;
}

.avatar {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    object-fit: cover;
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
}

.user-role {
    font-size: 12px;
    color: var(--text-muted);
}

/* ===== Main Content ===== */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 30px 40px;
    min-height: 100vh;
}

/* ===== Header ===== */
.header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 36px;
    animation: fadeInDown 0.5s ease;
}

.page-title {
    font-family: 'Playfair Display', serif;
    font-size: 32px;
    font-weight: 600;
    margin-bottom: 6px;
}

.page-subtitle {
    color: var(--text-secondary);
    font-size: 15px;
}

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

.search-box {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 10px 16px;
    min-width: 240px;
}

.search-box i {
    color: var(--text-muted);
}

.search-box input {
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 14px;
    width: 100%;
}

.search-box input::placeholder {
    color: var(--text-muted);
}

.notification-btn {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
}

.notification-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.notification-btn .badge {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 20px;
    height: 20px;
    background: var(--accent-primary);
    border-radius: 50%;
    font-size: 11px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.add-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-dark));
    border: none;
    border-radius: 10px;
    color: white;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 140, 66, 0.4);
}

.add-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 140, 66, 0.5);
}

/* ===== Stats Grid ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 18px;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    animation: fadeInUp 0.5s ease backwards;
}

.stat-card:nth-child(1) { animation-delay: 0.1s; }
.stat-card:nth-child(2) { animation-delay: 0.2s; }
.stat-card:nth-child(3) { animation-delay: 0.3s; }
.stat-card:nth-child(4) { animation-delay: 0.4s; }

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(255, 255, 255, 0.15);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100px;
    height: 100px;
    background: radial-gradient(circle, currentColor 0%, transparent 70%);
    opacity: 0.08;
    transform: translate(30%, -30%);
}

.stat-card[data-type="employees"] { color: var(--accent-teal); }
.stat-card[data-type="present"] { color: var(--accent-sage); }
.stat-card[data-type="leave"] { color: var(--accent-gold); }
.stat-card[data-type="openings"] { color: var(--accent-purple); }

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    background: currentColor;
    color: var(--bg-dark);
}

.stat-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.stat-label {
    font-size: 14px;
    color: var(--text-secondary);
}

.stat-trend {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
}

.stat-trend.up {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
}

.stat-trend.down {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
}

.stat-trend.neutral {
    background: rgba(156, 163, 175, 0.15);
    color: var(--text-secondary);
}

/* ===== Content Grid ===== */
.content-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    animation: fadeInUp 0.5s ease backwards;
}

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

.card-header h3 {
    font-size: 18px;
    font-weight: 600;
}

.view-all {
    color: var(--accent-primary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: gap 0.2s ease;
}

.view-all:hover {
    gap: 10px;
}

.btn-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-icon:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.mini-select {
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 8px 12px;
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
}

/* Chart Card */
.chart-card {
    grid-column: span 1;
    animation-delay: 0.5s;
}

.chart-container {
    display: flex;
    align-items: center;
    gap: 30px;
}

/* CSS-only Donut Chart */
.donut-chart {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    position: relative;
    background: conic-gradient(
        #ff6b35 0% 28%,
        #ff8c42 28% 50%,
        #ffab73 50% 68%,
        #ffd166 68% 85%,
        #f4a261 85% 100%
    );
    display: flex;
    align-items: center;
    justify-content: center;
}

.donut-center {
    width: 100px;
    height: 100px;
    background: var(--bg-card);
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.donut-total {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
}

.donut-label {
    font-size: 12px;
    color: var(--text-muted);
}

.chart-legend {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 4px;
}

.legend-label {
    flex: 1;
    font-size: 14px;
    color: var(--text-secondary);
}

.legend-value {
    font-weight: 600;
    color: var(--text-primary);
}

/* Attendance Card */
.attendance-card {
    animation-delay: 0.6s;
}

.bar-chart {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    height: 180px;
    padding-top: 20px;
}

.bar-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.bar-fill {
    width: 32px;
    height: var(--height, 50%);
    background: linear-gradient(180deg, var(--accent-light) 0%, rgba(255, 171, 115, 0.4) 100%);
    border-radius: 6px 6px 0 0;
    transition: all 0.3s ease;
}

.bar-item.active .bar-fill {
    background: linear-gradient(180deg, var(--accent-primary) 0%, rgba(255, 140, 66, 0.6) 100%);
}

.bar-item:hover .bar-fill {
    filter: brightness(1.1);
}

.bar-label {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
}

/* Employees Card */
.employees-card {
    grid-column: span 2;
    animation-delay: 0.7s;
}

.employee-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.employee-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px;
    background: var(--bg-dark);
    border-radius: 12px;
    transition: all 0.2s ease;
}

.employee-item:hover {
    background: var(--bg-hover);
    transform: translateX(4px);
}

.employee-avatar {
    width: 46px;
    height: 46px;
    border-radius: 10px;
    object-fit: cover;
}

.employee-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.employee-name {
    font-weight: 600;
    font-size: 15px;
}

.employee-role {
    font-size: 13px;
    color: var(--text-muted);
}

.employee-dept {
    padding: 6px 12px;
    background: rgba(255, 140, 66, 0.15);
    color: var(--accent-primary);
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
}

.employee-date {
    color: var(--text-muted);
    font-size: 13px;
    min-width: 100px;
    text-align: right;
}

/* Events Card */
.events-card {
    animation-delay: 0.8s;
}

.events-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.event-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px;
    background: var(--bg-dark);
    border-radius: 12px;
    transition: all 0.2s ease;
}

.event-item:hover {
    background: var(--bg-hover);
}

.event-date {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 50px;
    padding: 10px;
    background: linear-gradient(135deg, rgba(255, 140, 66, 0.2), rgba(255, 107, 53, 0.15));
    border-radius: 10px;
}

.event-day {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
}

.event-month {
    font-size: 12px;
    color: var(--accent-primary);
    font-weight: 500;
    text-transform: uppercase;
}

.event-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.event-title {
    font-weight: 600;
    font-size: 14px;
}

.event-time {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}

.event-badge {
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.event-badge.workshop {
    background: rgba(255, 217, 61, 0.15);
    color: var(--accent-gold);
}

.event-badge.meeting {
    background: rgba(96, 165, 250, 0.15);
    color: var(--accent-blue);
}

.event-badge.training {
    background: rgba(134, 239, 172, 0.15);
    color: var(--accent-sage);
}

/* Leave Card */
.leave-card {
    grid-column: span 2;
    animation-delay: 0.9s;
}

.pending-count {
    padding: 6px 12px;
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning);
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
}

.leave-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.leave-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px;
    background: var(--bg-dark);
    border-radius: 12px;
}

.leave-avatar {
    width: 46px;
    height: 46px;
    border-radius: 10px;
    object-fit: cover;
}

.leave-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.leave-name {
    font-weight: 600;
    font-size: 15px;
}

.leave-type {
    font-size: 13px;
    color: var(--accent-light);
}

.leave-dates {
    font-size: 12px;
    color: var(--text-muted);
}

.leave-actions {
    display: flex;
    gap: 8px;
}

.btn-approve, .btn-reject {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
}

.btn-approve {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
}

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

.btn-reject {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
}

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

/* ===== Animations ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

/* ===== Responsive ===== */
@media (max-width: 1400px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .content-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .employees-card,
    .leave-card {
        grid-column: span 2;
    }
}

@media (max-width: 1024px) {
    .sidebar {
        width: 80px;
    }
    
    .logo-text,
    .nav-item span,
    .user-info {
        display: none;
    }
    
    .logo {
        justify-content: center;
    }
    
    .nav-item {
        justify-content: center;
        padding: 14px;
    }
    
    .user-profile {
        justify-content: center;
    }
    
    .main-content {
        margin-left: 80px;
        padding: 20px;
    }
}

@media (max-width: 768px) {
    .header {
        flex-direction: column;
        gap: 20px;
    }
    
    .header-right {
        width: 100%;
        flex-wrap: wrap;
    }
    
    .search-box {
        flex: 1;
        min-width: 200px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .content-grid {
        grid-template-columns: 1fr;
    }
    
    .employees-card,
    .leave-card,
    .chart-card {
        grid-column: span 1;
    }
    
    .chart-container {
        flex-direction: column;
    }
}

