:root {
    --bg: #f8fafc;
    --card: #ffffff;
    --text: #0f172a;
    --heading: #020617;
    --muted: #64748b;
    --line: #e2e8f0;
    --line-subtle: #f1f5f9;
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --primary-soft: #eef2ff;
    --primary-border: #c7d2fe;
    --danger: #ef4444;
    --success: #10b981;
    --warning: #f59e0b;
    --info: #06b6d4;
    --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.04), 0 1px 2px rgba(15, 23, 42, 0.02);
    --shadow-md: 0 4px 20px -2px rgba(15, 23, 42, 0.05), 0 2px 6px -1px rgba(15, 23, 42, 0.03);
    --shadow-lg: 0 10px 25px -3px rgba(15, 23, 42, 0.08), 0 4px 10px -2px rgba(15, 23, 42, 0.04);
}

html, body {
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6, .brand, .metric, .page-head h1 {
    font-family: 'Outfit', 'Inter', sans-serif;
    letter-spacing: -0.02em;
    color: var(--heading);
}

.app {
    display: flex;
    min-height: 100vh;
    width: 100%;
    overflow-x: hidden;
}

/* Sidebar Styling */
.sidebar {
    width: 240px;
    background: linear-gradient(180deg, #0f172a 0%, #1e1b4b 100%);
    color: #fff;
    padding: 20px 16px;
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 10;
    box-shadow: 4px 0 24px rgba(15, 23, 42, 0.12);
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), padding 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-x: hidden;
    white-space: nowrap;
}

.brand {
    font-size: 22px;
    font-weight: 800;
    padding: 8px 12px 24px;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #a5b4fc 0%, #818cf8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    transition: font-size 0.3s ease, padding 0.3s ease;
}

.brand.compact {
    font-size: 15px;
    letter-spacing: -0.3px;
    word-break: break-word;
}

.nav .btn-nav {
    display: flex;
    align-items: center;
    width: 100%;
    border: 0;
    background: transparent;
    color: #94a3b8;
    text-align: left;
    padding: 11px 14px;
    border-radius: 10px;
    margin: 3px 0;
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav .btn-nav:hover {
    background: rgba(255, 255, 255, 0.09);
    color: #f8fafc;
    transform: translateX(2px);
}

.nav .btn-nav.active {
    background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
    color: #ffffff;
    font-weight: 600;
    box-shadow: 0 4px 14px rgba(79, 70, 229, 0.38);
}

.nav span {
    margin-left: 10px;
    transition: opacity 0.2s ease;
}

.main {
    margin-left: 240px;
    width: calc(100% - 240px);
    min-width: 0;
    flex: 1 1 0%;
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1), width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Collapsed Sidebar State */
.app.sidebar-collapsed .sidebar {
    width: 72px;
    padding: 20px 8px;
}

.app.sidebar-collapsed .main {
    margin-left: 72px;
    width: calc(100% - 72px);
}

.app.sidebar-collapsed .brand {
    padding: 8px 0 24px;
    text-align: center;
    font-size: 16px;
}

.app.sidebar-collapsed .nav .btn-nav {
    justify-content: center;
    padding: 12px 0;
}

.app.sidebar-collapsed .nav .btn-nav:hover {
    transform: none;
}

.app.sidebar-collapsed .nav .btn-nav span {
    display: none;
}

/* Header Styling */
.topbar {
    height: 64px;
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    position: sticky;
    top: 0;
    z-index: 5;
}

.search {
    width: 280px;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 8px 14px;
    background: #f1f5f9;
    font-size: 14px;
    transition: all 0.2s ease;
}

.search:focus {
    outline: none;
    border-color: var(--primary);
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

.user-mini {
    font-size: 14px;
    font-weight: 600;
}

.content {
    padding: 28px;
    max-width: 1500px;
    margin: auto;
}

.page-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.page-head h1 {
    margin: 0;
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.sub {
    color: var(--muted);
    font-size: 14px;
    margin-top: 4px;
}

/* Cards & Metric Cards */
.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 20px;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

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

.cards {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.cards .card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

.cards .card:nth-child(1) {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border-color: #bfdbfe;
    color: #1e40af;
}

.cards .card:nth-child(2) {
    background: linear-gradient(135deg, #ecfeff 0%, #cffafe 100%);
    border-color: #a5f3fc;
    color: #155e75;
}

.cards .card:nth-child(3) {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border-color: #bbf7d0;
    color: #166534;
}

.cards .card:nth-child(4) {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-color: #cbd5e1;
    color: #334155;
}

.cards .card:nth-child(5) {
    background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%);
    border-color: #fed7aa;
    color: #9a3412;
}

.cards .card:nth-child(6) {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border-color: #86efac;
    color: #14532d;
}

.metric {
    font-size: 30px;
    font-weight: 800;
    margin-top: 6px;
    line-height: 1.1;
}

.label {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.85;
}

/* Modern SaaS Pill Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid transparent;
    line-height: 1.2;
}

.badge.blue {
    background: #eef2ff;
    color: #3730a3;
    border-color: #c7d2fe;
}

.badge.cyan {
    background: #ecfeff;
    color: #155e75;
    border-color: #a5f3fc;
}

.badge.purple {
    background: #f3e8ff;
    color: #6b21a8;
    border-color: #e9d5ff;
}

.badge.indigo {
    background: #e0e7ff;
    color: #4338ca;
    border-color: #c7d2fe;
}

.badge.green {
    background: #ecfdf5;
    color: #065f46;
    border-color: #a7f3d0;
}

.badge.orange {
    background: #fffbebfb;
    color: #92400e;
    border-color: #fde68a;
}

.badge.red {
    background: #fff1f2;
    color: #9f1239;
    border-color: #fecdd3;
}

.badge.gray {
    background: #f8fafc;
    color: #475569;
    border-color: #e2e8f0;
}

/* Table Enhancements */
.table {
    border-color: var(--line-subtle);
}

.table thead th {
    background-color: #f8fafc;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--line);
    padding: 12px 16px;
}

.table tbody td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--line-subtle);
    font-size: 14px;
    transition: background-color 0.15s ease;
}

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

/* Button Refinements */
.btn {
    border-radius: 8px;
    font-weight: 600;
    padding: 7px 14px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-primary {
    background-color: var(--primary);
    border-color: var(--primary);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

/* Back Navigation Button */
.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    font-size: 13px;
    font-weight: 600;
    color: var(--muted);
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.btn-back:hover {
    color: var(--text);
    background: #f1f5f9;
    border-color: #cbd5e1;
}

/* Profile Icon Menu & Dropdowns */
.user-icon-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #f1f5f9;
    color: #334155;
    border: 1px solid var(--line);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    line-height: 1;
    transition: all 0.2s ease;
}

.user-icon-btn:hover, .user-icon-btn:focus {
    background: #e2e8f0;
    color: var(--primary);
    border-color: #cbd5e1;
}

.dropdown-toggle.no-caret::after {
    display: none !important;
}

/* Right Side Top Mobile Menu */
.mobile-top-menu {
    display: none !important;
}

.mobile-top-menu .dropdown-item {
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    transition: background-color 0.15s ease, color 0.15s ease;
}

.mobile-top-menu .dropdown-item.active,
.mobile-top-menu .dropdown-item:active {
    background-color: var(--primary);
    color: #ffffff;
}

/* Mobile Nav (Disabled - Footer menu removed) */
.mobile-nav {
    display: none !important;
}

@media(max-width:1200px) {
    .cards {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media(max-width:900px) {
    .sidebar {
        display: none;
    }

    #sidebarToggle {
        display: none !important;
    }

    .main,
    .app.sidebar-collapsed .main {
        margin-left: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
    }

    .topbar {
        padding: 0 16px;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    .search {
        width: 180px;
    }

    .content {
        padding: 16px 12px 24px;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    .page-head {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .page-head .actions {
        width: 100%;
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }

    .cards {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .mobile-top-menu {
        display: block !important;
    }
}

@media(max-width:576px) {
    .cards {
        grid-template-columns: 1fr;
    }

    .page-head h1 {
        font-size: 20px;
    }

    .search {
        width: 130px;
    }
}


