/* ==========================================================================
   CSS Custom Properties (Variables)
   ========================================================================== */
   :root {
    /* Color Palette - Premium Modern */
    --color-primary: #4f46e5;       /* Indigo 600 */
    --color-primary-hover: #4338ca; /* Indigo 700 */
    --color-primary-light: #e0e7ff; /* Indigo 100 */
    
    --color-secondary: #0ea5e9;     /* Sky 500 */
    --color-success: #10b981;       /* Emerald 500 */
    --color-warning: #f59e0b;       /* Amber 500 */
    --color-danger: #ef4444;        /* Red 500 */
    
    /* Backgrounds & Surfaces */
    --bg-main: #f8fafc;             /* Slate 50 */
    --bg-surface: #ffffff;
    --bg-sidebar: #ffffff;
    
    /* Typography */
    --text-primary: #0f172a;        /* Slate 900 */
    --text-secondary: #64748b;      /* Slate 500 */
    --text-muted: #94a3b8;          /* Slate 400 */
    
    /* Borders & Shadows */
    --border-color: #e2e8f0;        /* Slate 200 */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-glass: 0 8px 32px 0 rgba(31, 38, 135, 0.07);
    
    /* Metrics */
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-full: 9999px;
    --sidebar-width: 260px;
    --topbar-height: 70px;
    
    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==========================================================================
   Reset & Base Styles
   ========================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    margin: 0;
    overflow: hidden;
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    line-height: 1.5;
}

a {
    text-decoration: none;
    color: inherit;
}

button {
    border: none;
    background: none;
    cursor: pointer;
    font-family: inherit;
}

ul {
    list-style: none;
}

/* ==========================================================================
   Layout
   ========================================================================== */
.app-container {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    z-index: 10;
    box-shadow: var(--shadow-sm);
    transition: width var(--transition-normal);
}

.sidebar.collapsed {
    width: 80px;
}
.sidebar.collapsed .logo img,
.sidebar.collapsed .nav-item span,
.sidebar.collapsed .logout-btn span {
    display: none;
}
.sidebar.collapsed .nav-links {
    padding: 1.5rem 0.5rem;
}
.sidebar.collapsed .nav-item a,
.sidebar.collapsed .sidebar-footer a {
    justify-content: center;
    padding: 0.75rem;
}
.sidebar.collapsed .nav-item i,
.sidebar.collapsed .logout-btn i {
    font-size: 1.5rem;
    margin: 0;
}

.sidebar-header {
    height: var(--topbar-height);
    min-height: var(--topbar-height);
    max-height: var(--topbar-height);
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    border-bottom: 1px solid var(--border-color);
    box-sizing: border-box;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-primary);
}

.nav-links {
    flex: 1;
    padding: 1.5rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.nav-item a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-weight: 500;
    transition: all var(--transition-normal);
}

.nav-item a i {
    font-size: 1.25rem;
}

.nav-item a:hover {
    background-color: var(--bg-main);
    color: var(--color-primary);
    transform: translateX(4px);
}

.nav-item.active a {
    background-color: var(--color-primary-light);
    color: var(--color-primary);
}

.sidebar-footer {
    padding: 1.5rem 1rem;
    border-top: 1px solid var(--border-color);
}

.logout-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--color-danger);
    font-weight: 500;
    border-radius: var(--radius-md);
    transition: background-color var(--transition-fast);
}

.logout-btn:hover {
    background-color: #fef2f2;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Topbar */
.topbar {
    height: var(--topbar-height);
    min-height: var(--topbar-height);
    max-height: var(--topbar-height);
    background-color: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    position: sticky;
    top: 0;
    z-index: 5;
    /* Glassmorphism effect for topbar */
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
}

.search-bar {
    display: flex;
    align-items: center;
    background-color: var(--bg-main);
    border-radius: var(--radius-full);
    padding: 0.5rem 1rem;
    width: 300px;
    border: 1px solid transparent;
    transition: border-color var(--transition-fast);
}

.search-bar:focus-within {
    border-color: var(--color-primary);
    background-color: var(--bg-surface);
}

.search-bar i {
    color: var(--text-muted);
    font-size: 1.25rem;
}

.search-bar input {
    border: none;
    background: none;
    padding-left: 0.75rem;
    outline: none;
    width: 100%;
    color: var(--text-primary);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.notification-btn {
    position: relative;
    font-size: 1.5rem;
    color: var(--text-secondary);
    transition: color var(--transition-fast);
}

.notification-btn:hover {
    color: var(--text-primary);
}

.badge {
    position: absolute;
    top: -2px;
    right: -4px;
    background-color: var(--color-danger);
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: var(--radius-full);
    border: 2px solid var(--bg-surface);
}

.avatar img {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    object-fit: cover;
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-info .name {
    font-weight: 600;
    font-size: 0.9rem;
}

.user-info .role {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* Content Wrapper */
.content-wrapper {
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

/* ==========================================================================
   Dashboard Components
   ========================================================================== */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.page-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.025em;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-top: 0.25rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.25rem;
    border-radius: var(--radius-md);
    font-weight: 500;
    font-size: 0.9rem;
    transition: all var(--transition-fast);
}

.btn-primary {
    background-color: var(--color-primary);
    color: white;
    box-shadow: 0 4px 6px rgba(79, 70, 229, 0.2);
}

.btn-primary:hover {
    background-color: var(--color-primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 8px rgba(79, 70, 229, 0.3);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background-color: var(--bg-surface);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-icon.purple { background-color: #f3e8ff; color: #9333ea; }
.stat-icon.orange { background-color: #ffedd5; color: #ea580c; }
.stat-icon.blue { background-color: #e0f2fe; color: #0284c7; }
.stat-icon.green { background-color: #dcfce7; color: #16a34a; }

.stat-details {
    display: flex;
    flex-direction: column;
}

.stat-title {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0.25rem 0;
}

.stat-trend {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.8rem;
    font-weight: 500;
}

.stat-trend.positive { color: var(--color-success); }
.stat-trend.negative { color: var(--color-danger); }
.stat-trend.neutral { color: var(--text-muted); }

/* Tables & Cards */
.card {
    background-color: var(--bg-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.card-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h2 {
    font-size: 1.1rem;
    font-weight: 600;
}

.mt-4 { margin-top: 1.5rem; }

.modern-table {
    width: 100%;
    border-collapse: collapse;
}

.modern-table th,
.modern-table td {
    padding: 1rem 1.5rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.modern-table th {
    background-color: var(--bg-main);
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.modern-table tbody tr {
    transition: background-color var(--transition-fast);
}

.modern-table tbody tr:hover {
    background-color: var(--bg-main);
}

.user-cell {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-cell img {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
}

.user-cell .user-name {
    display: block;
    font-weight: 500;
    color: var(--text-primary);
}

.user-cell .user-email {
    display: block;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 500;
}

.status-active { background-color: #dcfce7; color: #166534; }
.status-paused { background-color: #fef9c3; color: #854d0e; }

.progress-bar-container {
    width: 100%;
    background-color: var(--bg-main);
    border-radius: var(--radius-full);
    height: 6px;
    margin-bottom: 0.25rem;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    border-radius: var(--radius-full);
}

.bg-success { background-color: var(--color-success); }
.bg-warning { background-color: var(--color-warning); }

.progress-text {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.btn-outline-sm {
    border: 1px solid var(--border-color);
    padding: 0.4rem 0.75rem;
    border-radius: var(--radius-md);
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.btn-outline-sm:hover {
    background-color: var(--bg-main);
    color: var(--text-primary);
    border-color: var(--text-muted);
}


