:root {
    --slate-50: #f8fafc;
    --slate-100: #f1f5f9;
    --slate-200: #e2e8f0;
    --slate-300: #cbd5e1;
    --slate-400: #94a3b8;
    --slate-500: #64748b;
    --slate-600: #475569;
    --slate-700: #334155;
    --slate-800: #1e293b;
    --slate-900: #0f172a;
    --slate-950: #020617;

    --blue-400: #60a5fa;
    --blue-500: #3b82f6;
    --blue-600: #2563eb;

    --purple-500: #a855f7;
    --purple-600: #9333ea;

    --sidebar-width: 16rem;
    --header-height: 4rem;
}

body.app-body,
.app-layout {
    margin: 0;
    padding: 0;
    font-family: 'Outfit', sans-serif;
    background-color: var(--slate-50);
    color: var(--slate-600);
    height: 100vh;
    display: flex;
    overflow: hidden;
}

/* Sidebar */
.app-sidebar {
    background-color: var(--slate-900);
    color: var(--slate-300);
    width: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    height: 100vh;
    border-right: 1px solid var(--slate-800);

    /* Mobile First: Fixed and Hidden */
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 50;
    transform: translateX(-100%);
    transition: transform 0.3s ease-in-out;
}

/* Desktop: Static and Visible */
@media (min-width: 1024px) {
    .app-sidebar {
        position: static;
        transform: translateX(0);
    }
}

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

.sidebar-header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    border-bottom: 1px solid var(--slate-800);
    background-color: var(--slate-950);
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.brand-icon {
    background: linear-gradient(to bottom right, var(--blue-500), var(--purple-600));
    padding: 0.375rem;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.brand-text {
    font-size: 1.25rem;
    font-weight: 700;
    background: linear-gradient(to right, var(--blue-400), var(--purple-500));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem 0.75rem 6rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.nav-group-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 0.75rem;
    margin-bottom: 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--slate-500);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
}

.nav-group-label:hover {
    color: var(--slate-300);
}

.nav-items {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.nav-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    transition: background-color 0.2s, color 0.2s;
    text-decoration: none;
    cursor: pointer;
    color: var(--slate-400);
}

.nav-link:hover {
    background-color: var(--slate-800);
    color: var(--slate-200);
}

.nav-link.active {
    background-color: rgba(37, 99, 235, 0.1);
    /* blue-600/10 */
    color: var(--blue-400);
    font-weight: 500;
}

.nav-link-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.nav-icon {
    width: 1.125rem;
    height: 1.125rem;
    color: var(--slate-500);
}

.nav-link.active .nav-icon {
    color: var(--blue-400);
}

/* Sidebar Footer */
.sidebar-cta {
    padding: 1rem;
    border-top: 1px solid var(--slate-800);
    background-color: rgba(15, 23, 42, 0.5);
    /* slate-900/50 */
}

.upgrade-card {
    background: linear-gradient(to bottom right, #6366f1, #9333ea);
    /* indigo-500 to purple-600 */
    border-radius: 0.75rem;
    padding: 1rem;
    color: white;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.upgrade-btn {
    display: block;
    width: 100%;
    text-align: center;
    padding: 0.5rem;
    background-color: white;
    color: #4f46e5;
    /* indigo-600 */
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 0.5rem;
    margin-top: 0.75rem;
    text-decoration: none;
    transition: background-color 0.2s;
}

.upgrade-btn:hover {
    background-color: #e0e7ff;
    /* indigo-50 */
}

.sidebar-user {
    padding: 1rem;
    border-top: 1px solid var(--slate-800);
}

.user-profile-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    border-radius: 0.5rem;
    transition: background-color 0.2s;
    text-decoration: none;
}

.user-profile-link:hover {
    background-color: var(--slate-800);
}

.user-avatar {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    border: 2px solid var(--slate-700);
}

/* Main Content */
.app-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

.top-header {
    height: var(--header-height);
    background-color: white;
    border-bottom: 1px solid var(--slate-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1rem;
    flex-shrink: 0;
}

@media (min-width: 1024px) {
    .top-header {
        padding: 0 2rem;
    }
}

.header-left,
.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.breadcrumb {
    display: none;
    align-items: center;
    font-size: 0.875rem;
    color: var(--slate-500);
}

@media (min-width: 768px) {
    .breadcrumb {
        display: flex;
    }
}

.search-container {
    display: none;
    position: relative;
}

@media (min-width: 768px) {
    .search-container {
        display: block;
    }
}

.search-input {
    width: 16rem;
    padding: 0.5rem 1rem 0.5rem 2.25rem;
    border-radius: 0.5rem;
    background-color: var(--slate-100);
    border: none;
    font-size: 0.875rem;
    color: var(--slate-900);
    outline: none;
    transition: box-shadow 0.2s, background-color 0.2s;
}

.search-input:focus {
    background-color: white;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
    /* ring-blue-500/20 */
}

.search-icon {
    position: absolute;
    left: 0.75rem;
    top: 0.625rem;
    color: var(--slate-400);
}

.icon-btn {
    padding: 0.5rem;
    color: var(--slate-500);
    border-radius: 0.5rem;
    background: none;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s;
}

.icon-btn:hover {
    background-color: var(--slate-100);
}

.mobile-toggle-btn {
    display: block;
}

@media (min-width: 1024px) {
    .mobile-toggle-btn {
        display: none;
    }
}

/* Scrollable Area */
.content-scrollable {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    background-color: var(--slate-50);
}

@media (min-width: 1024px) {
    .content-scrollable {
        padding: 2rem;
    }
}

.content-container {
    max-width: 80rem;
    /* 7xl */
    margin: 0 auto;
}

/* Mobile Overlay */
.mobile-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(15, 23, 42, 0.5);
    z-index: 40;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.mobile-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

@media (min-width: 1024px) {
    .mobile-overlay {
        display: none;
    }
}

/* Utility to hide scrollbar but keep functionality */
.no-scrollbar::-webkit-scrollbar {
    display: none;
}

.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* --- MERGED FROM SIDEBAR.HTML --- */

/* Sidebar Utility Helpers */
.sb-group {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.sb-menu-list {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

/* Logout Button Specifics */
.btn-logout-sidebar {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    margin-top: 1rem;
    color: #ef4444;
    /* red-500 */
    font-size: 0.875rem;
    font-weight: 500;
    background: transparent;
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-logout-sidebar:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: #ef4444;
}

/* Notification Badge */
.notification-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 1.25rem;
    height: 1.25rem;
    padding: 0 0.25rem;
    font-size: 0.75rem;
    font-weight: 700;
    background-color: var(--blue-500);
    color: white;
    border-radius: 9999px;
}

/* Mobile Sidebar Adjustments */
@media (max-width: 1024px) {
    .app-sidebar nav {
        padding-bottom: 8rem !important;
        height: calc(100dvh - 4rem) !important;
    }
}

/* --- UTILITY CLASSES REPLACING TAILWIND --- */
.relative {
    position: relative;
}

.absolute {
    position: absolute;
}

.fixed {
    position: fixed;
}

.bg-red-500 {
    background-color: #ef4444;
}

.text-red-500 {
    color: #ef4444;
}

.rounded-full {
    border-radius: 9999px;
}

.w-2 {
    width: 0.5rem;
}

.h-2 {
    height: 0.5rem;
}

.w-5 {
    width: 1.25rem;
}

.h-5 {
    height: 1.25rem;
}

.top-2 {
    top: 0.5rem;
}

.right-2 {
    right: 0.5rem;
}

.ring-2 {
    box-shadow: 0 0 0 2px var(--tw-ring-color);
}

.ring-white {
    --tw-ring-color: #ffffff;
}

/* Text Utilities for Sidebar Text */
.text-xs {
    font-size: 0.75rem;
    line-height: 1rem;
}

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

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

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

.uppercase {
    text-transform: uppercase;
}

.tracking-wider {
    letter-spacing: 0.05em;
}

.cursor-pointer {
    cursor: pointer;
}

.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Flex Utilities needed if not using flexbox classes directly */
.items-center {
    align-items: center;
}

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

.gap-3 {
    gap: 0.75rem;
}