/* ===== Reset & Base ===== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-primary: #0f0f1a;
    --bg-secondary: #1a1a2e;
    --bg-tertiary: #16213e;
    --bg-card: #1a1a2e;
    --bg-hover: #222244;
    --text-primary: #e0e0e0;
    --text-secondary: #a0a0b0;
    --text-muted: #606070;
    --accent: #4a9eff;
    --accent-hover: #3a8eef;
    --accent-muted: #2a4a7f;
    --border: #2a2a3e;
    --danger: #e74c3c;
    --success: #2ecc71;
    --warning: #f39c12;
    --radius: 8px;
    --radius-sm: 4px;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    --header-height: 60px;
    --sidebar-width: 240px;
}

html, body {
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
    font-size: 14px;
    color: var(--text-primary);
    background: var(--bg-primary);
    line-height: 1.5;
}

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

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo {
    font-size: 18px;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: -0.5px;
}

.header-center {
    flex: 1;
    max-width: 500px;
    margin: 0 24px;
}

.search-bar input {
    width: 100%;
    padding: 8px 16px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.search-bar input:focus {
    border-color: var(--accent);
}

.search-bar input::placeholder {
    color: var(--text-muted);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    font-size: 13px;
}

/* ===== Layout ===== */
.app-layout {
    display: flex;
    height: calc(100vh - var(--header-height));
}

/* ===== Sidebar ===== */
.sidebar {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    padding: 20px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    overflow-y: auto;
}

.filter-section {
    margin-bottom: 24px;
}

.filter-section h3 {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.filter-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 13px;
    transition: background 0.15s;
}

.filter-option:hover {
    background: var(--bg-hover);
}

.filter-option input[type="checkbox"] {
    accent-color: var(--accent);
}

.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

/* ===== Content ===== */
.content {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}

.content-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.asset-count {
    color: var(--text-muted);
    font-size: 13px;
}

.view-toggles {
    display: flex;
    gap: 4px;
}

/* ===== Asset Grid ===== */
.asset-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.asset-grid.list-view {
    grid-template-columns: 1fr;
}

.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 80px 20px;
    color: var(--text-muted);
}

.empty-state p {
    margin-bottom: 8px;
}

/* ===== Modal ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
}

.modal-overlay[hidden] {
    display: none;
}

.modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow);
}

.modal-large {
    max-width: 900px;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}

.modal-header h2 {
    font-size: 16px;
    font-weight: 600;
}

.modal-body {
    padding: 20px;
}
