@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

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

:root {
    --sidebar-bg: #0f1117;
    --sidebar-header-bg: #1a1d2e;
    --sidebar-width: 280px;
    --accent: #6366f1;
    --accent-hover: #818cf8;
    --accent-glow: rgba(99, 102, 241, 0.3);
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --item-hover: rgba(99, 102, 241, 0.12);
    --item-active: rgba(99, 102, 241, 0.22);
    --border: rgba(255, 255, 255, 0.06);
    --subnav-bg: rgba(0, 0, 0, 0.2);
    --search-bg: rgba(255, 255, 255, 0.06);
    --search-border: rgba(255, 255, 255, 0.1);
    --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    height: 100vh;
    overflow: hidden;
    background: #0a0c14;
    font-family: 'Inter', Arial, sans-serif;
}

.container {
    display: flex;
    height: 100vh;
}

/* ── SIDEBAR ───────────────────────────────────── */
.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    color: var(--text-primary);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: transform var(--transition);
    border-right: 1px solid var(--border);
    flex-shrink: 0;
    z-index: 100;
}

/* Header */
.sidebar-header {
    background: var(--sidebar-header-bg);
    padding: 22px 20px 18px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.sidebar-header .brand {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.sidebar-header .brand-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.sidebar-header h2 {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.3px;
    background: linear-gradient(135deg, #f1f5f9, #94a3b8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sidebar-header p {
    font-size: 11px;
    color: var(--text-secondary);
    font-weight: 400;
}

/* Search Bar */
.search-wrapper {
    position: relative;
}

.search-icon {
    position: absolute;
    left: 11px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    font-size: 14px;
    pointer-events: none;
    transition: color var(--transition);
}

#searchInput {
    width: 100%;
    padding: 9px 12px 9px 34px;
    background: var(--search-bg);
    border: 1px solid var(--search-border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 13px;
    font-family: 'Inter', sans-serif;
    outline: none;
    transition: all var(--transition);
}

#searchInput::placeholder {
    color: var(--text-secondary);
}

#searchInput:focus {
    border-color: var(--accent);
    background: rgba(99, 102, 241, 0.08);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

#searchInput:focus + .search-icon,
.search-wrapper:focus-within .search-icon {
    color: var(--accent-hover);
}

/* Nav List */
.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 10px 0;
}

.sidebar-nav::-webkit-scrollbar {
    width: 4px;
}
.sidebar-nav::-webkit-scrollbar-track {
    background: transparent;
}
.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}
.sidebar-nav::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

.nav-section-label {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--text-secondary);
    padding: 10px 20px 6px;
    opacity: 0.7;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 20px;
    cursor: pointer;
    border-left: 3px solid transparent;
    transition: all var(--transition);
    color: var(--text-secondary);
    font-size: 13.5px;
    font-weight: 500;
    user-select: none;
    position: relative;
}

.nav-item .nav-icon {
    font-size: 16px;
    flex-shrink: 0;
    transition: transform var(--transition);
}

.nav-item .nav-label {
    flex: 1;
}

.nav-item .nav-arrow {
    font-size: 11px;
    transition: transform var(--transition);
    color: var(--text-secondary);
    opacity: 0.6;
}

.nav-item:hover {
    background: var(--item-hover);
    color: var(--text-primary);
    border-left-color: var(--accent);
}

.nav-item:hover .nav-icon {
    transform: scale(1.1);
}

.nav-item.active {
    background: var(--item-active);
    color: var(--text-primary);
    border-left-color: var(--accent);
}

.nav-item.active .nav-label {
    color: var(--accent-hover);
    font-weight: 600;
}

.nav-item.hidden {
    display: none;
}

/* Sub-navigation */
.subnav-container {
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.subnav-container.open {
    max-height: 200px;
}

.nav-item.has-subnav.subnav-open .nav-arrow {
    transform: rotate(90deg);
}

.subnav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 20px 9px 44px;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 12.5px;
    font-weight: 400;
    border-left: 3px solid transparent;
    background: var(--subnav-bg);
    transition: all var(--transition);
    user-select: none;
}

.subnav-item .sub-icon {
    font-size: 14px;
    flex-shrink: 0;
}

.subnav-item:hover {
    background: var(--item-hover);
    color: var(--text-primary);
    border-left-color: var(--accent-hover);
}

.subnav-item.active {
    background: var(--item-active);
    color: var(--accent-hover);
    border-left-color: var(--accent);
    font-weight: 500;
}

.subnav-item.hidden {
    display: none;
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 14px 20px;
    border-top: 1px solid var(--border);
    font-size: 11px;
    color: var(--text-secondary);
    text-align: center;
    flex-shrink: 0;
    background: var(--sidebar-header-bg);
}

.sidebar-footer span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

/* ── CONTENT AREA ───────────────────────────────── */
.content {
    flex: 1;
    position: relative;
    overflow: hidden;
    background: #f8fafc;
}

#contentFrame {
    width: 100%;
    height: 100%;
    border: none;
    background: white;
}

/* Menu Button (mobile) */
#menuBtn {
    position: absolute;
    top: 15px;
    left: 15px;
    z-index: 999;
    padding: 9px 15px;
    border: none;
    border-radius: 8px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
    cursor: pointer;
    display: none;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.3px;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
    transition: all var(--transition);
}

#menuBtn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
}

#menuBtn:active {
    transform: translateY(0);
}

/* No results message */
.no-results {
    padding: 20px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 13px;
    display: none;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        position: absolute;
        top: 0;
        left: 0;
        height: 100%;
        transform: translateX(-100%);
        box-shadow: 4px 0 30px rgba(0, 0, 0, 0.5);
    }

    .sidebar.visible {
        transform: translateX(0);
    }

    #menuBtn {
        display: flex !important;
        align-items: center;
        gap: 6px;
    }
}