:root {
    --bs-primary: #af0000;
    --bs-primary-rgb: 175, 0, 0;
    --sidebar-width: 240px;
    --header-height: 64px;
    --bg-main: #f8fafc;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-main);
    color: #1e293b;
    height: 100vh;
    overflow: hidden;
    font-size: 0.875rem;
}

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

/* Sidebar Customization */
.sidebar {
    width: var(--sidebar-width);
    flex: 0 0 var(--sidebar-width);
    min-width: var(--sidebar-width);
    overflow: hidden;
    background: #ffffff;
    border-right: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transform: translateX(0);
    opacity: 1;
    transition: width 0.3s ease-in-out, min-width 0.3s ease-in-out, flex-basis 0.3s ease-in-out, transform 0.3s ease-in-out, opacity 0.3s ease-in-out, visibility 0.3s ease-in-out, border-color 0.3s ease-in-out;
    will-change: width, min-width, flex-basis, transform, opacity;
}

.sidebar-collapsed .sidebar {
    width: 0;
    flex-basis: 0;
    min-width: 0;
    transform: translateX(calc(var(--sidebar-width) * -1));
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    border-right-color: transparent;
}

.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease-in-out;
}

.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

.sidebar-header {
    height: var(--header-height);
    min-height: var(--header-height);
    display: flex;
    align-items: center;
    padding: 0 1.25rem;
    border-bottom: 1px solid #e2e8f0;
    box-sizing: border-box;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0.5rem 0.75rem;
    color: #64748b;
    font-weight: 500;
    font-size: 0.85rem;
    border-radius: 6px;
    margin: 1px 0.5rem;
    transition: all 0.2s;
}

.nav-link:hover {
    background-color: #f1f5f9;
    color: #0f172a;
}

.nav-link.active {
    background-color: #fef2f2 !important;
    color: #af0000 !important;
    font-weight: 600;
}

.nav-link i {
    font-size: 1rem;
}

.nav-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    color: #94a3b8;
    letter-spacing: 0.05em;
    padding: 1rem 1rem 0.5rem;
    font-weight: 700;
}

/* Main Content */
.main-wrapper {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    transition: all 0.3s ease-in-out;
}

.top-navbar {
    height: var(--header-height);
    min-height: var(--header-height);
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid #e2e8f0;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 999;
    box-sizing: border-box;
}

.search-container {
    max-width: 320px;
    width: 100%;
}

.search-input {
    background-color: #f1f5f9;
    border: 1px solid transparent;
    border-radius: 6px;
    padding: 0.5rem 0.75rem 0.5rem 2.5rem;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.search-input:focus {
    background-color: #ffffff;
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 3px rgba(175, 0, 0, 0.1);
    outline: none;
}

.search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    pointer-events: none;
    font-size: 0.85rem;
}

.content-container {
    padding: 1.5rem;
    max-width: 1600px;
    margin: 0;
    width: 100%;
}

/* Modern Scrollbar */
.main-wrapper::-webkit-scrollbar {
    width: 5px;
}

.main-wrapper::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

/* Premium Shadow and Transitions */
.card {
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    border-radius: 8px;
}

.card-header {
    padding: 0.75rem 1rem;
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
}

.card-body {
    padding: 1rem;
}

.smaller {
    font-size: 0.75rem !important;
}

.font-monospace {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
}

/* SweetAlert2 Theme Customization */
.swal2-popup {
    font-size: 0.85rem !important;
    border-radius: 12px !important;
}

.swal2-styled.swal2-confirm {
    background-color: #af0000 !important;
}

.swal2-title {
    font-size: 1.1rem !important;
    font-weight: 700 !important;
}

.swal2-html-container {
    font-size: 0.85rem !important;
    color: #64748b !important;
}

/* Responsive Design */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        height: 100vh;
        left: 0;
        top: 0;
        bottom: 0;
        width: var(--sidebar-width);
        min-width: var(--sidebar-width);
        flex-basis: var(--sidebar-width);
        transform: translateX(calc(var(--sidebar-width) * -1));
        opacity: 0;
        visibility: hidden;
        box-shadow: 10px 0 30px rgba(0, 0, 0, 0.1);
    }

    .sidebar-mobile-open .sidebar {
        transform: translateX(0);
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

    .top-navbar {
        padding: 0 1rem;
    }

    .search-container {
        display: none;
    }

    .content-container {
        padding: 1rem;
    }

    .main-wrapper {
        margin-left: 0 !important;
    }
}
