:root {
    /* Color Palette - Premium Corporate Look */
    --primary-color: #2563eb;
    /* Royal Blue */
    --primary-hover: #1d4ed8;
    --secondary-color: #64748b;
    /* Slate */
    --accent-color: #0ea5e9;
    /* Sky Blue */

    --bg-body: #f8fafc;
    /* Very light slate */
    --bg-surface: #ffffff;
    --bg-sidebar: #0f172a;
    /* Dark Navy */

    --text-main: #1e293b;
    --text-muted: #64748b;
    --text-light: #f1f5f9;

    --border-color: #e2e8f0;

    /* Shadows & Glassmorphism */
    --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);

    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: 1px solid rgba(255, 255, 255, 0.5);
    --backdrop-blur: blur(12px);

    /* Spacing & Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;

    --header-height: 64px;
    --sidebar-width: 260px;
}

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

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.5;
    height: 100vh;
    display: flex;
    overflow: hidden;
}

/* Utilities */
.opacity-50 {
    opacity: 0.5;
}

.flex {
    display: flex;
}

.items-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.flex-col {
    flex-direction: column;
}

.grid {
    display: grid;
}

.gap-4 {
    gap: 1rem;
}

.gap-6 {
    gap: 1.5rem;
}

.p-4 {
    padding: 1rem;
}

.p-6 {
    padding: 1.5rem;
}

.mt-4 {
    margin-top: 1rem;
}

.mb-4 {
    margin-bottom: 1rem;
}

.text-sm {
    font-size: 0.875rem;
}

.font-bold {
    font-weight: 600;
}

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

.text-primary {
    color: var(--primary-color);
}

.w-full {
    width: 100%;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    outline: none;
    font-size: 0.875rem;
    gap: 0.5rem;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.2);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
}

.btn-outline {
    background-color: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-main);
}

.btn-outline:hover {
    background-color: var(--bg-body);
    border-color: var(--text-muted);
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-sidebar);
    color: var(--text-light);
    height: 100%;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 2.5rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: white;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: #94a3b8;
    text-decoration: none;
    border-radius: var(--radius-md);
    transition: all 0.2s;
    margin-bottom: 0.25rem;
}

.nav-link:hover,
.nav-link.active {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
}

.nav-link i {
    width: 20px;
    text-align: center;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    position: relative;
}

/* Topbar */
.topbar {
    height: var(--header-height);
    background-color: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
}

.search-bar {
    display: flex;
    align-items: center;
    background-color: var(--bg-body);
    padding: 0.5rem 1rem;
    border-radius: 99px;
    /* Pill shape */
    border: 1px solid transparent;
    width: 300px;
    transition: all 0.2s;
}

.search-bar:focus-within {
    background-color: white;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
}

.search-bar input {
    background: transparent;
    border: none;
    outline: none;
    margin-left: 0.5rem;
    width: 100%;
    font-size: 0.9rem;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
}

.avatar {
    width: 36px;
    height: 36px;
    background-color: var(--primary-color);
    border-radius: 50%;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.9rem;
}

/* Dashboard Content */
.content-area {
    padding: 2rem;
    overflow-y: auto;
    flex: 1;
}

.page-header {
    margin-bottom: 2rem;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
}

/* Cards */
.card {
    background-color: var(--bg-surface);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    transition: transform 0.2s;
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1;
}

.stat-trend {
    font-size: 0.8rem;
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.text-success {
    color: #10b981;
}

.text-danger {
    color: #ef4444;
}

/* Table Section */
.section-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.table-container {
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    background-color: #f8fafc;
    text-align: left;
    padding: 1rem 1.5rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    font-weight: 600;
    border-bottom: 1px solid var(--border-color);
}

td {
    padding: 1rem 1.5rem;
    font-size: 0.9rem;
    color: var(--text-main);
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

tr:last-child td {
    border-bottom: none;
}

tr:hover td {
    background-color: #f8fafc;
}

/* Badges */
.badge {
    padding: 0.25rem 0.6rem;
    border-radius: 99px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-success {
    background: #dcfce7;
    color: #166534;
}

.badge-warning {
    background: #fef9c3;
    color: #854d0e;
}

.badge-info {
    background: #e0f2fe;
    color: #075985;
}

.badge-danger {
    background: #fee2e2;
    color: #991b1b;
}

/* Avatar Group for tables */
.avatar-sm {
    width: 32px;
    height: 32px;
    font-size: 0.75rem;
    margin-right: 0.75rem;

    display: inline-flex;
}

/* Refactoring: Unified Utility Classes */
.text-accent {
    color: var(--accent-color);
}

.nav-section-title {
    margin-top: 2rem;
    padding-left: 1rem;
    font-size: 0.75rem;
    color: #475569;
    text-transform: uppercase;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.btn-bell {
    border: none;
    color: var(--text-muted);
    font-size: 1.1rem;
}

.view-all-link {
    text-decoration: none;
    font-weight: 500;
}

.back-link {
    text-decoration: none;
}


.btn-sm {
    padding: 0.25rem 0.5rem;
}

.avatar-blue {
    background: #e0f2fe;
    color: #0369a1;
}

.avatar-pink {
    background: #fdf2f8;
    color: #be185d;
}

.avatar-green {
    background: #f0fdf4;
    color: #15803d;
}

.avatar-indigo {
    background: #e0e7ff;
    color: #3730a3;
}

.avatar-slate {
    background: #f1f5f9;
    color: #64748b;
}

.avatar-group .avatar {
    border: 2px solid white;
    /* usually avatar groups need borders to look good overlapped */
}

/* Z-Index Utilities for Avatar Groups */
.z-1 {
    z-index: 1;
}

.z-2 {
    z-index: 2;
}

.z-3 {
    z-index: 3;
}