/* Global Premium Variables */
:root {
    --primary-color: #1a56ff;
    --primary-hover: #003cd6;
    --bg-app: #f4f7fb;
    --bg-sidebar: #ffffff;
    --bg-header: #ffffff;
    --text-main: #334155;
    --text-muted: #64748b;
    --border-light: #e2e8f0;

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -4px rgba(0, 0, 0, 0.05);

    --sidebar-width: 110px;
    --header-height: 70px;
    --transition-speed: 0.3s;
}

body {
    margin: 0;
    font-family: 'Inter', 'Outfit', 'Poppins', sans-serif;
    background-color: var(--bg-app);
    color: var(--text-main);
    overflow-x: hidden;
}

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

/* Sidebar */
.app-sidebar {
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
    transition: transform var(--transition-speed);
    z-index: 40;
}

.sidebar-header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    padding: 0 24px;
    border-bottom: 1px solid var(--border-light);
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--primary-color);
    gap: 12px;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

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

.nav-item:hover {
    background: #f8fafc;
    color: var(--primary-color);
}

.nav-item.active {
    background: var(--primary-color);
    color: #fff;
    box-shadow: 0 4px 12px rgba(26, 86, 255, 0.2);
}

/* Main Content Area */
.app-main {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* Header */
.app-header {
    height: var(--header-height);
    background: var(--bg-header);
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    z-index: 30;
}

.header-title h1 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-main);
}

.header-title p {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.header-actions {
    display: flex;
    gap: 12px;
}

/* Page Content */
.app-content {
    flex: 1;
    overflow-x: hidden;
    padding: 32px;
}

/* Mobile Toggle & Responsiveness */
.mobile-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    color: var(--text-main);
}

@media (max-width: 1024px) {
    .app-main {
        margin-left: 0;
    }

    .app-sidebar {
        position: fixed;
        transform: translateX(-100%);
        height: 100%;
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.1);
    }

    .app-sidebar.open {
        transform: translateX(0);
    }

    .mobile-toggle {
        display: block;
    }

    .app-content {
        padding: 16px;
    }

    .app-header {
        padding: 0 16px;
    }
}

/* Cards & Dashboards */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.metric-card {
    background: #fff;
    border-radius: 16px;
    padding: 24px;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: flex-start;
    gap: 16px;
    border: 1px solid var(--border-light);
    transition: transform 0.2s, box-shadow 0.2s;
}

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

.metric-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.metric-info h3 {
    margin: 0;
    font-size: 0.875rem;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.metric-info .metric-value {
    margin: 8px 0 0;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-main);
}

/* UI Helpers */
.modern-table-wrapper {
    background: #fff;
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    overflow-x: auto;
}

/* Scrollbar styling for modern look */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Overriding some default tailwind table behaviors to look more premium */
table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

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

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

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