:root {
    /* Theme Logo Colors */
    --primary-color: #f7931e; /* Vibrant Orange/Yellow from logo */
    --primary-hover: #e6800e;
    --secondary-color: #ffb84d;
    --success-color: #2ecc71;
    --warning-color: #f1c40f;
    --danger-color: #e74c3c;
    --info-color: #3498db;
    
    /* Backgrounds & Surfaces */
    --bg-main: #f4f7fe;
    --bg-surface: #ffffff;
    --bg-sidebar: #1a1a2e; /* Deep rich dark blue/black */
    
    /* Text Colors */
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-sidebar: #ffffff;
    
    /* Layout */
    --sidebar-width: 260px;
    --header-height: 70px;
    
    /* Effects & Animations */
    --shadow-sm: 0 4px 6px rgba(0,0,0,0.02);
    --shadow-md: 0 10px 20px rgba(0,0,0,0.05);
    --shadow-hover: 0 15px 25px rgba(247, 147, 30, 0.15);
    --border-radius: 16px;
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

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

@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-30px); }
    to { opacity: 1; transform: translateX(0); }
}

.fade-in-up {
    animation: fadeInUp 0.6s cubic-bezier(0.25, 0.8, 0.25, 1) forwards;
    opacity: 0;
}

/* Layout System */
.app-container {
    display: flex;
    min-height: 100vh;
    position: relative;
}

.app-sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-sidebar);
    color: var(--text-sidebar);
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    z-index: 100;
    transition: var(--transition);
    overflow-y: auto;
    box-shadow: 4px 0 15px rgba(0,0,0,0.05);
}

.app-main {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: var(--transition);
    width: calc(100% - var(--sidebar-width));
}

.app-header {
    height: var(--header-height);
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    padding: 0 30px;
    position: sticky;
    top: 0;
    z-index: 90;
    transition: var(--transition);
}

.app-content {
    padding: 30px;
    flex: 1;
}

/* Typography & Utilities */
h1, h2, h3, h4, h5, h6 {
    color: var(--text-primary);
    font-weight: 700;
    margin-bottom: 15px;
    letter-spacing: -0.5px;
}

.text-muted { color: var(--text-secondary); }

.card {
    background: var(--bg-surface);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    padding: 24px;
    margin-bottom: 24px;
    border: none;
    transition: var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

/* Sidebar Styling */
.sidebar-menu {
    list-style: none;
    padding: 20px 0;
}

.sidebar-menu li {
    padding: 4px 20px;
    animation: slideInLeft 0.5s ease forwards;
    opacity: 0;
}

.sidebar-menu li:nth-child(1) { animation-delay: 0.1s; }
.sidebar-menu li:nth-child(2) { animation-delay: 0.2s; }
.sidebar-menu li:nth-child(3) { animation-delay: 0.3s; }

.sidebar-menu a {
    display: flex;
    align-items: center;
    padding: 12px 18px;
    color: #8f9bba;
    text-decoration: none;
    border-radius: 12px;
    transition: var(--transition);
    font-weight: 600;
    position: relative;
    overflow: hidden;
}

.sidebar-menu a::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    height: 0;
    width: 4px;
    background: var(--primary-color);
    border-radius: 0 4px 4px 0;
    transition: var(--transition);
}

.sidebar-menu a:hover, .sidebar-menu a.active {
    background: rgba(247, 147, 30, 0.1);
    color: white;
}

.sidebar-menu a.active::before {
    height: 60%;
}

.sidebar-menu a svg {
    transition: var(--transition);
    margin-right: 12px;
}

.sidebar-menu a:hover svg, .sidebar-menu a.active svg {
    transform: scale(1.1);
    color: var(--primary-color);
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    font-family: inherit;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    box-shadow: 0 4px 10px rgba(247, 147, 30, 0.3);
}

.btn-primary:hover {
    box-shadow: 0 6px 15px rgba(247, 147, 30, 0.5);
    transform: translateY(-2px);
}

/* Dashboard Specifics */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    margin-bottom: 24px;
}

.stat-card {
    display: flex;
    align-items: center;
    padding: 30px 24px;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.stat-icon {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(247, 147, 30, 0.1);
    color: var(--primary-color);
    margin-right: 20px;
    font-size: 28px;
    transition: var(--transition);
}

.stat-details h4 {
    margin: 0;
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
}

.stat-details h2 {
    margin: 0;
    font-size: 32px;
    color: var(--text-primary);
    line-height: 1.2;
}

/* Responsive Table Container */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

table {
    width: 100%;
    text-align: left;
    border-collapse: separate;
    border-spacing: 0 8px;
    margin-top: 15px;
    min-width: 600px; /* Ensures table doesn't squish too much */
}

th {
    padding: 12px 16px;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

td {
    padding: 16px;
    background: var(--bg-surface);
    transition: var(--transition);
}

tbody tr {
    transition: var(--transition);
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

tbody tr td:first-child { border-top-left-radius: 10px; border-bottom-left-radius: 10px; }
tbody tr td:last-child { border-top-right-radius: 10px; border-bottom-right-radius: 10px; }

tbody tr:hover {
    transform: scale(1.01) translateY(-1px);
    box-shadow: var(--shadow-md);
    position: relative;
    z-index: 10;
}

/* Header Avatar */
.header-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 18px;
    box-shadow: 0 4px 8px rgba(247, 147, 30, 0.3);
}

/* Mobile Sidebar Overlay */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.5);
    z-index: 95;
    display: none;
}

/* Responsive Media Queries */
@media (max-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .app-sidebar {
        transform: translateX(-100%); /* Hide sidebar by default */
    }
    
    .app-main {
        margin-left: 0;
        width: 100%;
    }
    
    .mobile-sidebar-open .app-sidebar {
        transform: translateX(0); /* Show sidebar when open */
    }
    
    .mobile-sidebar-open .sidebar-overlay {
        display: block; /* Show overlay */
    }

    .app-header {
        padding: 0 15px;
    }
    
    .app-content {
        padding: 15px;
    }
    
    .mobile-toggle {
        display: block !important;
    }
    
    .sidebar-close-btn {
        display: block !important;
    }
    
    .header-title {
        font-size: 16px !important;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .stat-card {
        padding: 20px 15px;
    }
    
    .stat-icon {
        width: 50px;
        height: 50px;
        font-size: 24px;
    }
    
    .stat-details h2 {
        font-size: 24px;
    }
}
