/* ===========================
   CSS Variables — Dark Theme
   =========================== */
:root {
    --color-background: #121212;
    --color-surface: #1E1E1E;
    --color-sidebar: #181818;
    --color-accent: #2979FF;
    --color-text-primary: #E0E0E0;
    --color-text-secondary: #9E9E9E;
    --color-border: #2C2C2C;
    --color-hover: #252525;
    --color-danger: #CF6679;
    --color-success: #4CAF50;
}

/* ===========================
   Reset & Base
   =========================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--color-background);
    color: var(--color-text-primary);
    font-size: 15px;
    line-height: 1.5;
}

a {
    color: var(--color-accent);
    text-decoration: none;
}

    a:hover {
        opacity: 0.85;
    }

h1, h2, h3, h4 {
    color: var(--color-text-primary);
    font-weight: 600;
}

/* ===========================
   App Layout
   =========================== */
.app-layout {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

.app-content {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
    transition: margin-right 0.3s ease;
}

/* ===========================
   Sidebar
   =========================== */
.sidebar {
    display: flex;
    flex-direction: column;
    background-color: var(--color-sidebar);
    border-left: 1px solid var(--color-border);
    height: 100vh;
    transition: width 0.3s ease;
    overflow: hidden;
    position: relative;
    flex-shrink: 0;
}

    .sidebar.expanded {
        width: 220px;
    }

    .sidebar.collapsed {
        width: 56px;
    }

.sidebar-toggle {
    position: absolute;
    top: 1rem;
    left: 0.75rem;
    background: none;
    border: none;
    color: var(--color-text-secondary);
    cursor: pointer;
    font-size: 1.1rem;
    padding: 0.25rem;
    transition: color 0.2s;
}

    .sidebar-toggle:hover {
        color: var(--color-text-primary);
    }

.sidebar-nav {
    display: flex;
    flex-direction: column;
    margin-top: 3.5rem;
    flex: 1;
}

.sidebar-item {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.75rem 1rem;
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
    white-space: nowrap;
    text-decoration: none;
    border: none;
    background: none;
    width: 100%;
    font-size: 0.95rem;
}

    .sidebar-item:hover {
        background-color: var(--color-hover);
        color: var(--color-text-primary);
    }

    .sidebar-item.active {
        color: var(--color-accent);
        background-color: rgba(41, 121, 255, 0.08);
    }

    .sidebar-item .icon {
        font-size: 1.2rem;
        flex-shrink: 0;
        width: 24px;
        text-align: center;
    }

    .sidebar-item .label {
        opacity: 1;
        transition: opacity 0.2s;
    }

.sidebar.collapsed .sidebar-item .label {
    opacity: 0;
    pointer-events: none;
}

.sidebar-divider {
    border: none;
    border-top: 1px solid var(--color-border);
    margin: 0.5rem 0;
}

.sidebar-section-title {
    padding: 0.5rem 1rem;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-text-secondary);
    white-space: nowrap;
    overflow: hidden;
}

.sidebar.collapsed .sidebar-section-title {
    opacity: 0;
}

/* ===========================
   Filters Panel
   =========================== */
.filter-group {
    padding: 0.5rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

    .filter-group label {
        font-size: 0.75rem;
        color: var(--color-text-secondary);
    }

    .filter-group input,
    .filter-group select {
        background-color: var(--color-background);
        border: 1px solid var(--color-border);
        border-radius: 4px;
        color: var(--color-text-primary);
        padding: 0.4rem 0.6rem;
        font-size: 0.85rem;
        width: 100%;
    }

        .filter-group input:focus,
        .filter-group select:focus {
            outline: none;
            border-color: var(--color-accent);
        }

.sidebar.collapsed .filter-group {
    display: none;
}

.btn-clear-filters {
    margin: 0.5rem 1rem;
    padding: 0.4rem 0.6rem;
    background: none;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    color: var(--color-text-secondary);
    font-size: 0.8rem;
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s;
}

    .btn-clear-filters:hover {
        border-color: var(--color-accent);
        color: var(--color-text-primary);
    }

.sidebar.collapsed .btn-clear-filters {
    display: none;
}

/* ===========================
   Scrollbar
   =========================== */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--color-background);
}

::-webkit-scrollbar-thumb {
    background: var(--color-border);
    border-radius: 3px;
}

    ::-webkit-scrollbar-thumb:hover {
        background: var(--color-text-secondary);
    }

/* ===========================
   Image Protection — Layer 3
   =========================== */
.protected img {
    pointer-events: none;
    user-select: none;
    -webkit-user-drag: none;
}