:root {
    --primary-color: #06b6d4;
    --secondary-color: #0e7490;
    --bg-color: #f3f4f6;
    --text-color: #1f2937;
    --sidebar-width: 260px;
    --header-height: 60px;
    --card-bg: #ffffff;
    --border-color: #e5e7eb;
}

[data-theme="dark"] {
    --bg-color: #0f172a;
    --text-color: #f1f5f9;
    --card-bg: #1e293b;
    --border-color: #334155;
    --primary-color: #22d3ee;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    transition: background-color 0.3s, color 0.3s;
}

/* Header */
.header {
    height: var(--header-height);
    background-color: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
}

.icon-btn {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: var(--text-color);
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: background 0.2s;
}

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

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--card-bg);
    border-right: 1px solid var(--border-color);
    position: fixed;
    top: var(--header-height);
    bottom: 0;
    left: 0;
    overflow-y: auto;
    transition: transform 0.3s ease;
    z-index: 90;
    padding: 20px 0;
}

.sidebar.closed {
    transform: translateX(-100%);
}

.sidebar .searchbar {
    padding: 0 15px;
    margin-bottom: 20px;
    position: relative;
}

.sidebar .searchbar input {
    width: 100%;
    padding: 10px 10px 10px 35px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-color);
    color: var(--text-color);
}

.sidebar .searchbar i {
    position: absolute;
    left: 25px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--secondary-color);
}

.subsection-header {
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    padding: 12px 20px;
    color: var(--text-color);
    cursor: pointer;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.subsection-header:hover {
    background-color: var(--bg-color);
}

.dropdown-content {
    display: none;
    background-color: rgba(0,0,0,0.02);
}

.dropdown-content.show {
    display: block;
}

.dropdown-content a {
    display: block;
    padding: 10px 20px 10px 40px;
    color: var(--text-color);
    text-decoration: none;
    font-size: 0.95rem;
}

.dropdown-content a:hover {
    color: var(--primary-color);
    background-color: var(--bg-color);
}

/* Main Content */
.main {
    margin-left: var(--sidebar-width);
    margin-top: var(--header-height);
    padding: 20px;
    transition: margin-left 0.3s;
}

.main.expanded {
    margin-left: 0;
}

.section {
    max-width: 1200px;
    margin: 0 auto 30px;
}

.section h2, .section h3 {
    margin-bottom: 20px;
    color: var(--text-color);
}

/* Utilities */
.overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 80;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .main {
        margin-left: 0;
    }
    .overlay.active {
        display: block;
    }
}
