/**
 * DAM Multi-Tenant - Dark Theme Professional UI
 */

/* ========================================
   CSS Variables - Dark Theme
   ======================================== */
:root {
    /* Dark background colors */
    --bg-primary: #0f1419;
    --bg-secondary: #1a2332;
    --bg-tertiary: #243447;
    --bg-card: #1e2d3d;
    --bg-hover: #2a3f54;
    --bg-input: #1a2332;

    /* Text colors */
    --text-primary: #ffffff;
    --text-secondary: #8899a6;
    --text-muted: #5c6d7e;
    --text-placeholder: #4a5568;

    /* Accent colors */
    --accent-primary: #1da1f2;
    --accent-secondary: #17bf63;
    --accent-warning: #ffad1f;
    --accent-danger: #e0245e;
    --accent-purple: #794bc4;

    /* Border colors */
    --border-color: #2f3e50;
    --border-light: #38444d;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.5);

    /* Sizes */
    --sidebar-width: 240px;
    --header-height: 60px;
    --detail-panel-width: 380px;

    /* Border radius */
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s ease;
}

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

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

a {
    color: var(--accent-primary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

input, select, textarea, button {
    font-family: inherit;
    font-size: inherit;
}

/* ========================================
   App Container
   ======================================== */
#app {
    height: 100vh;
    display: flex;
    flex-direction: column;
}

.view {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}

.view.hidden {
    display: none !important;
}

.hidden {
    display: none !important;
}

/* ========================================
   Header
   ======================================== */
.header {
    height: var(--header-height);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    padding: 0 20px;
    gap: 20px;
    flex-shrink: 0;
}

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

.header-center {
    flex: 1;
    display: flex;
    justify-content: center;
    max-width: 500px;
    margin: 0 auto;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.logo svg {
    width: 28px;
    height: 28px;
    color: var(--accent-primary);
}

.logo .tenant-logo-img {
    max-height: 40px;
    max-width: 180px;
    width: auto;
    height: auto;
    object-fit: contain;
}

.logo.has-tenant-logo .default-logo-icon,
.logo.has-tenant-logo .default-logo-text {
    display: none;
}

.logo.has-tenant-logo .tenant-logo-img {
    display: block !important;
}

.search-box {
    position: relative;
    width: 100%;
    max-width: 400px;
}

.search-box svg {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--text-muted);
    pointer-events: none;
}

.search-box input {
    width: 100%;
    padding: 10px 16px 10px 42px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
    transition: var(--transition-fast);
}

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

.search-box input:focus {
    border-color: var(--accent-primary);
    background: var(--bg-input);
}

.tenant-selector {
    position: relative;
}

.tenant-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 13px;
    cursor: pointer;
    transition: var(--transition-fast);
}

.tenant-btn:hover {
    background: var(--bg-hover);
    border-color: var(--accent-primary);
}

.tenant-btn svg {
    width: 16px;
    height: 16px;
    color: var(--text-muted);
}

.tenant-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    min-width: 220px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    display: none;
    z-index: 1000;
}

.tenant-dropdown.open {
    display: block;
}

.tenant-list {
    padding: 8px;
}

.tenant-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 13px;
    color: var(--text-primary);
    transition: var(--transition-fast);
}

.tenant-item:hover {
    background: var(--bg-hover);
}

.tenant-item.active {
    background: var(--accent-primary);
    color: white;
}

.tenant-item .tenant-name {
    font-weight: 500;
}

.tenant-item .role-badge {
    font-size: 10px;
    padding: 2px 6px;
    background: rgba(255,255,255,0.2);
    border-radius: var(--radius-sm);
}

.upload-header-btn {
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.header-logo .logo-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-purple));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-logo .logo-icon svg {
    width: 20px;
    height: 20px;
    color: white;
}

.header-search {
    flex: 1;
    max-width: 500px;
    position: relative;
}

.header-search input {
    width: 100%;
    padding: 10px 16px 10px 42px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    color: var(--text-primary);
    outline: none;
    transition: var(--transition-fast);
}

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

.header-search input:focus {
    border-color: var(--accent-primary);
    background: var(--bg-input);
}

.header-search svg {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--text-muted);
}

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

/* Upload Button */
.btn-upload {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--accent-primary);
    color: white;
    border: none;
    border-radius: var(--radius-lg);
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-fast);
}

.btn-upload:hover {
    background: #1a91da;
    transform: translateY(-1px);
}

.btn-upload svg {
    width: 18px;
    height: 18px;
}

/* User Menu */
.user-menu {
    position: relative;
}

.user-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--border-color);
    overflow: hidden;
    cursor: pointer;
    transition: var(--transition-fast);
    background: none;
    padding: 0;
}

.user-btn:hover {
    border-color: var(--accent-primary);
}

.user-btn img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-btn .avatar {
    width: 100%;
    height: 100%;
    background: var(--accent-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 16px;
}

.user-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 200px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    display: none;
    z-index: 1000;
}

.user-dropdown.open {
    display: block;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    color: var(--text-primary);
    transition: var(--transition-fast);
}

.dropdown-item:hover {
    background: var(--bg-hover);
    text-decoration: none;
}

.dropdown-item svg {
    width: 18px;
    height: 18px;
    color: var(--text-secondary);
}

.dropdown-divider {
    height: 1px;
    background: var(--border-color);
    margin: 4px 0;
}

.user-dropdown-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
}

.user-dropdown-info {
    flex: 1;
    min-width: 0;
}

.user-dropdown-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 14px;
}

.user-dropdown-email {
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--accent-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    flex-shrink: 0;
}

.avatar-lg {
    width: 48px;
    height: 48px;
    font-size: 18px;
}

.text-danger {
    color: var(--accent-danger) !important;
}

.text-danger svg {
    color: var(--accent-danger) !important;
}

/* ========================================
   Main Layout
   ======================================== */
.main-container {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* ========================================
   Sidebar
   ======================================== */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    flex-shrink: 0;
}

.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

/* Sidebar Navigation */
.sidebar-nav {
    padding: 16px 12px;
    border-bottom: 1px solid var(--border-color);
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    color: var(--text-secondary);
    border-radius: var(--radius-md);
    transition: var(--transition-fast);
    margin-bottom: 4px;
}

.nav-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    text-decoration: none;
}

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

.nav-item svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.nav-item span {
    flex: 1;
}

.nav-badge {
    background: var(--accent-warning);
    color: #000;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
    flex: 0 0 auto;
}

.nav-item.active .nav-badge {
    background: rgba(255, 255, 255, 0.3);
    color: white;
}

/* Sidebar Sections */
.sidebar-section {
    padding: 12px;
    border-top: 1px solid var(--border-color);
}

.sidebar-nav + .sidebar-section {
    border-top: none;
}

.sidebar-title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 8px;
    padding: 0 12px;
}

.sidebar-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 4px;
    margin-bottom: 8px;
}

.sidebar-section-header h3 {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin: 0;
}

.sidebar-divider {
    height: 1px;
    background: var(--border-color);
    margin: 8px 12px;
}

.sidebar-section-compact {
    padding: 8px 12px;
    border-top: 1px solid var(--border-color);
    margin-top: 8px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 500;
    transition: var(--transition-fast);
}

.sidebar-link:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.sidebar-link.active {
    background: var(--accent-primary);
    color: white;
}

.btn-icon-small {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
}

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

.empty-state-small {
    font-size: 12px;
    color: var(--text-muted);
    padding: 8px 12px;
    font-style: italic;
}

.collections-list {
    padding: 0;
}

.collection-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition-fast);
    font-size: 13px;
}

.collection-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.collection-item svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* Tags Sidebar List */
.tags-sidebar-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 4px 0;
}

.tag-sidebar-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    font-size: 12px;
    border-radius: 12px;
    cursor: pointer;
    transition: var(--transition-fast);
    background: var(--bg-hover);
    color: var(--text-secondary);
    border: 1px solid transparent;
}

.tag-sidebar-item:hover {
    border-color: var(--border-color);
    transform: translateY(-1px);
}

.tag-sidebar-item.active {
    background: var(--accent-primary);
    color: white;
}

.tag-sidebar-item .tag-color {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.tag-sidebar-item .tag-count {
    font-size: 10px;
    opacity: 0.7;
    margin-left: 2px;
}

.tags-sidebar-empty {
    font-size: 12px;
    color: var(--text-muted);
    font-style: italic;
    padding: 4px 0;
}

/* Tag Modal */
.color-picker-row {
    display: flex;
    gap: 10px;
    align-items: center;
}

.form-control-color {
    width: 50px;
    height: 38px;
    padding: 4px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    background: var(--bg-primary);
}

.form-control-color::-webkit-color-swatch-wrapper {
    padding: 2px;
}

.form-control-color::-webkit-color-swatch {
    border: none;
    border-radius: var(--radius-sm);
}

.tag-assets-section {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.tag-assets-section h4 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.tag-assets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 8px;
    max-height: 200px;
    overflow-y: auto;
}

.tag-asset-thumb {
    aspect-ratio: 1;
    border-radius: var(--radius-sm);
    overflow: hidden;
    cursor: pointer;
    border: 1px solid var(--border-color);
    transition: var(--transition-fast);
}

.tag-asset-thumb:hover {
    border-color: var(--accent-primary);
    transform: scale(1.05);
}

.tag-asset-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.tag-asset-thumb .file-icon {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    color: var(--text-muted);
}

.tag-asset-more {
    aspect-ratio: 1;
    border-radius: var(--radius-sm);
    background: var(--bg-hover);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

/* Tags View - Main Content Area */
.tags-view-container {
    padding: 0;
}

.tags-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    padding: 20px;
}

.tag-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    cursor: pointer;
    transition: var(--transition-fast);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.tag-card:hover {
    border-color: var(--accent-primary);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.tag-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
}

.tag-card-color {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    flex-shrink: 0;
}

.tag-card-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

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

.tag-card-actions {
    display: flex;
    gap: 8px;
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
    position: relative;
    z-index: 10;
}

.tag-card-actions .btn {
    flex: 1;
    padding: 6px 10px;
    font-size: 12px;
    cursor: pointer;
    position: relative;
    z-index: 11;
}

.tags-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.tags-empty svg {
    width: 64px;
    height: 64px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.tags-empty p {
    font-size: 16px;
    margin-bottom: 16px;
}

/* Tag Detail View */
.tag-detail-view {
    padding: 0;
}

.tag-detail-header {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 16px 20px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
}

.tag-detail-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.tag-detail-color {
    width: 32px;
    height: 32px;
    border-radius: 8px;
}

.tag-detail-info h2 {
    font-size: 20px;
    font-weight: 600;
    margin: 0;
    color: var(--text-primary);
}

.tag-detail-count {
    font-size: 14px;
    color: var(--text-muted);
    background: var(--bg-hover);
    padding: 4px 10px;
    border-radius: 12px;
}

.tag-detail-actions {
    display: flex;
    gap: 8px;
}

.tag-assets-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
    padding: 20px;
}

.tag-asset-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: pointer;
    transition: var(--transition-fast);
}

.tag-asset-card:hover {
    border-color: var(--accent-primary);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.tag-asset-card-preview {
    aspect-ratio: 1;
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.tag-asset-card-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.tag-asset-card-preview .file-icon {
    color: var(--text-muted);
}

.tag-asset-card-preview .file-icon svg {
    width: 48px;
    height: 48px;
}

.tag-asset-card-info {
    padding: 12px;
}

.tag-asset-card-title {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-bottom: 4px;
}

.tag-asset-card-meta {
    font-size: 11px;
    color: var(--text-muted);
}

.tag-assets-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
    font-weight: 600;
}

/* Tag files grid */
#tag-files-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    padding: 16px 0;
}

#tag-files-grid .asset-card {
    width: 200px;
    height: auto;
}

.empty-message,
.error-message {
    padding: 40px 20px;
    text-align: center;
    color: var(--text-muted);
    width: 100%;
}

.error-message {
    color: var(--danger);
}

/* Folder Tree */
.folder-tree {
    padding: 0;
}

.taxonomy-tree {
    padding: 0;
}

.taxonomy-tree .empty-state-small {
    padding: 8px 4px;
}

.folder-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition-fast);
    user-select: none;
}

.folder-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.folder-item.active {
    background: var(--bg-tertiary);
    color: var(--accent-primary);
}

.folder-item .folder-icon {
    width: 18px;
    height: 18px;
    color: var(--accent-primary);
    flex-shrink: 0;
}

.folder-item .folder-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 13px;
}

.folder-item .folder-arrow {
    color: var(--text-muted);
    font-size: 14px;
    margin-left: auto;
    opacity: 0.5;
}

.folder-item.active .folder-arrow {
    opacity: 1;
    color: var(--accent-primary);
}

/* New Folder Button */
.btn-new-folder {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: calc(100% - 24px);
    margin: 8px 12px;
    padding: 10px;
    background: transparent;
    border: 1px dashed var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition-fast);
}

.btn-new-folder:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.btn-new-folder svg {
    width: 18px;
    height: 18px;
}

/* Sidebar Items (Favorites, Collections, etc) */
.sidebar-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition-fast);
}

.sidebar-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.sidebar-item.active {
    color: var(--accent-primary);
}

.sidebar-item svg {
    width: 18px;
    height: 18px;
}

.sidebar-item .item-icon {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
}

.sidebar-item .item-icon.yellow { background: var(--accent-warning); color: #000; }
.sidebar-item .item-icon.green { background: var(--accent-secondary); color: white; }
.sidebar-item .item-icon.blue { background: var(--accent-primary); color: white; }
.sidebar-item .item-icon.purple { background: var(--accent-purple); color: white; }

.sidebar-add {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 13px;
}

.sidebar-add:hover {
    color: var(--accent-primary);
}

/* ========================================
   Content Area
   ======================================== */
.content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--bg-primary);
}

/* Toolbar */
.toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-primary);
    flex-shrink: 0;
    gap: 16px;
}

.toolbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.toolbar-title {
    font-size: 20px;
    font-weight: 600;
}

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

.breadcrumb a {
    color: var(--text-secondary);
}

.breadcrumb a:hover {
    color: var(--accent-primary);
    text-decoration: none;
}

.breadcrumb span {
    color: var(--text-muted);
}

.breadcrumb-separator {
    color: var(--text-muted);
}

.breadcrumb-item {
    color: var(--text-secondary);
    cursor: pointer;
    transition: color 0.2s;
}

.breadcrumb-item:hover {
    color: var(--accent-primary);
}

.breadcrumb-item.active {
    color: var(--text-primary);
    font-weight: 500;
    cursor: default;
}

.breadcrumb-item.active:hover {
    color: var(--text-primary);
}

.breadcrumb-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--bg-hover);
    padding: 4px 10px;
    border-radius: 12px;
    font-weight: 500;
    color: var(--text-primary);
}

.breadcrumb-tag .tag-color {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

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

/* Filter Dropdowns */
.filter-dropdown {
    position: relative;
}

.filter-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition-fast);
    font-size: 13px;
}

.filter-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.filter-btn svg {
    width: 16px;
    height: 16px;
}

.filter-menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    min-width: 180px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    display: none;
    z-index: 100;
}

.filter-menu.open {
    display: block;
}

.filter-option {
    padding: 10px 14px;
    cursor: pointer;
    transition: var(--transition-fast);
}

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

.filter-option.selected {
    color: var(--accent-primary);
}

/* View Toggle */
.view-toggle {
    display: flex;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    padding: 2px;
}

.view-toggle button {
    padding: 8px 12px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.view-toggle button:hover {
    color: var(--text-primary);
}

.view-toggle button.active {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.view-toggle button svg {
    width: 18px;
    height: 18px;
}

/* ========================================
   Assets View
   ======================================== */
#view-assets {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.assets-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-primary);
    flex-shrink: 0;
}

.assets-toolbar .breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-secondary);
}

.assets-toolbar .breadcrumb svg {
    width: 16px;
    height: 16px;
}

.assets-toolbar .breadcrumb a {
    color: var(--text-secondary);
}

.assets-toolbar .breadcrumb a:hover {
    color: var(--accent-primary);
}

.filters-group {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.filters-group label {
    font-size: 12px;
    color: var(--text-muted);
}

.filters-group select {
    padding: 6px 10px;
    font-size: 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
}

/* Filters Bar */
.filters-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
    padding: 12px 24px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-group label {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
}

.filter-select {
    padding: 6px 12px;
    font-size: 13px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    min-width: 100px;
}

.filter-taxonomy-group {
    display: contents;
}

.active-taxonomy-filter {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: var(--accent-primary);
    color: white;
    border-radius: var(--radius-sm);
    font-size: 13px;
}

.active-taxonomy-filter .btn-icon-small {
    color: white;
    opacity: 0.8;
}

.active-taxonomy-filter .btn-icon-small:hover {
    opacity: 1;
}

/* ========================================
   Taxonomy Tokens (Detail Panel Autocomplete)
   ======================================== */
.taxonomy-input-group {
    margin-bottom: 16px;
}

.taxonomy-input-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.taxonomy-input-group label .required {
    color: var(--accent-danger);
}

.taxonomy-tokens {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    min-height: 42px;
    position: relative;
    align-items: center;
}

.taxonomy-tokens:focus-within {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(29, 161, 242, 0.1);
}

.taxonomy-tokens-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.taxonomy-token {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    background: var(--accent-primary);
    color: white;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 500;
}

.taxonomy-token .token-remove {
    background: none;
    border: none;
    padding: 0;
    margin-left: 2px;
    cursor: pointer;
    color: white;
    opacity: 0.7;
    font-size: 14px;
    line-height: 1;
}

.taxonomy-token .token-remove:hover {
    opacity: 1;
}

.taxonomy-input {
    flex: 1;
    min-width: 80px;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 13px;
    padding: 4px;
}

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

.taxonomy-input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.taxonomy-suggestions {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    margin-top: 4px;
    z-index: 100;
    max-height: 180px;
    overflow-y: auto;
}

.taxonomy-suggestions.show {
    display: block;
}

.taxonomy-suggestion {
    padding: 10px 12px;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-primary);
    transition: var(--transition-fast);
}

.taxonomy-suggestion:hover {
    background: var(--bg-hover);
}

.taxonomy-suggestions .no-suggestions {
    padding: 10px 12px;
    font-size: 12px;
    color: var(--text-muted);
    font-style: italic;
}

.taxonomy-tokens-readonly {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.taxonomy-token-readonly {
    display: inline-block;
    padding: 4px 10px;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-radius: var(--radius-sm);
    font-size: 12px;
}

/* ========================================
   Asset Browser (Container for Grid + Detail Panel)
   ======================================== */
.asset-browser {
    flex: 1;
    display: flex;
    overflow: hidden;
}

/* ========================================
   Asset Grid
   ======================================== */
.asset-container {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px;
}

.asset-container::-webkit-scrollbar {
    width: 8px;
}

.asset-container::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

.asset-container::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

/* Folders Grid */
.folders-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 24px;
}

.folder-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    cursor: pointer;
    transition: var(--transition-normal);
    width: 200px;
    height: 170px; /* Fixed height: same as asset cards */
    flex-shrink: 0;
}

.folder-card:hover {
    background: var(--bg-hover);
    border-color: var(--accent-primary);
    transform: translateY(-2px);
}

.folder-card-icon {
    width: 200px;
    height: 112px; /* 16:9 ratio */
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.folder-card-icon svg {
    width: 48px;
    height: 48px;
    color: var(--accent-primary);
}

.folder-card-name {
    padding: 12px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Assets Grid */
.assets-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.asset-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    cursor: pointer;
    transition: var(--transition-normal);
    position: relative;
    width: 200px;
    height: 170px; /* Fixed height: 112px thumb + ~58px info */
    flex-shrink: 0;
}

.asset-card:hover {
    border-color: var(--accent-primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.asset-card-thumb,
.asset-card-preview {
    width: 200px;
    height: 112px; /* 16:9 ratio */
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.asset-card-thumb img,
.asset-card-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.asset-card-thumb svg,
.asset-card-preview svg,
.asset-card-preview .file-icon {
    width: 48px;
    height: 48px;
    color: var(--text-muted);
}

/* Favorite button on asset cards */
.favorite-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.5);
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: var(--transition-fast);
    z-index: 10;
}

.favorite-btn svg {
    width: 18px !important;
    height: 18px !important;
    color: white;
}

.asset-card:hover .favorite-btn {
    opacity: 1;
}

.favorite-btn:hover {
    background: rgba(0, 0, 0, 0.7);
    transform: scale(1.1);
}

.favorite-btn.active {
    opacity: 1;
    background: var(--accent-warning);
}

.favorite-btn.active svg {
    color: #000;
}

.favorite-btn.active:hover {
    background: #e69500;
}

/* Asset badges */
.asset-badge {
    position: absolute;
    top: 8px;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
}

.asset-badge.favorite {
    left: 8px;
    background: var(--accent-warning);
    color: #000;
}

.asset-badge.status {
    right: 8px;
    background: var(--accent-secondary);
    color: white;
}

.asset-card-info {
    padding: 12px;
}

.asset-card-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-bottom: 4px;
}

.asset-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 11px;
    color: var(--text-muted);
}

.asset-card-type {
    text-transform: capitalize;
}

.asset-card-actions {
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: var(--transition-fast);
}

.asset-card:hover .asset-card-actions {
    opacity: 1;
}

/* List View */
.asset-container.list-view .folders-grid,
.asset-container.list-view .assets-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.asset-container.list-view .folder-card {
    display: flex;
    flex-direction: row;
    align-items: center;
    padding: 0;
    width: 100%;
    height: auto; /* Override fixed height for list view */
}

.asset-container.list-view .folder-card-icon {
    aspect-ratio: auto;
    width: 48px;
    height: 48px;
    flex-shrink: 0;
}

.asset-container.list-view .folder-card-icon svg {
    width: 24px;
    height: 24px;
}

.asset-container.list-view .folder-card-name {
    flex: 1;
    padding: 12px 16px;
}

.asset-container.list-view .asset-card {
    display: flex;
    flex-direction: row;
    align-items: center;
    width: 100%;
    height: auto; /* Override fixed height for list view */
}

.asset-container.list-view .asset-card-thumb,
.asset-container.list-view .asset-card-preview {
    aspect-ratio: auto;
    width: 64px;
    height: 48px;
    flex-shrink: 0;
}

.asset-container.list-view .asset-card-thumb img,
.asset-container.list-view .asset-card-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.asset-container.list-view .asset-card-thumb svg,
.asset-container.list-view .asset-card-preview svg,
.asset-container.list-view .asset-card-preview .file-icon {
    width: 24px;
    height: 24px;
}

.asset-container.list-view .asset-card-info {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
}

.asset-container.list-view .asset-card-name {
    flex: 1;
    margin-bottom: 0;
    margin-right: 16px;
}

.asset-container.list-view .asset-card-meta {
    width: auto;
    gap: 24px;
}

.asset-container.list-view .asset-card-actions {
    opacity: 1;
    margin-left: 16px;
}

/* Detail Panel moved to end of file */

.detail-title {
    font-size: 16px;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}

.detail-actions {
    display: flex;
    gap: 8px;
}

.detail-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.detail-preview {
    width: 100%;
    aspect-ratio: 16/10;
    background: var(--bg-tertiary);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.detail-preview img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.detail-preview svg {
    width: 64px;
    height: 64px;
    color: var(--text-muted);
}

/* Detail panel favorite button */
.detail-favorite-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(0, 0, 0, 0.5);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-fast);
    z-index: 10;
}

.detail-favorite-btn svg {
    width: 24px !important;
    height: 24px !important;
    color: white;
}

.detail-favorite-btn:hover {
    background: rgba(0, 0, 0, 0.7);
    transform: scale(1.1);
}

.detail-favorite-btn.active {
    background: var(--accent-warning);
}

.detail-favorite-btn.active svg {
    color: #000;
}

.detail-favorite-btn.active:hover {
    background: #e69500;
}

.file-icon-large {
    display: flex;
    align-items: center;
    justify-content: center;
}

.file-icon-large svg {
    width: 64px;
    height: 64px;
    color: var(--text-muted);
}

/* Detail Form Fields */
.detail-field {
    margin-bottom: 20px;
}

.detail-label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.detail-input {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    outline: none;
    transition: var(--transition-fast);
}

.detail-input:focus {
    border-color: var(--accent-primary);
}

.detail-textarea {
    resize: vertical;
    min-height: 80px;
}

.detail-link {
    color: var(--accent-primary);
    font-size: 13px;
    cursor: pointer;
}

.detail-link:hover {
    text-decoration: underline;
}

/* Detail Info */
.detail-info {
    display: flex;
    gap: 16px;
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.detail-info-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.detail-info-value {
    color: var(--text-primary);
    font-weight: 500;
}

/* Tags */
.tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}

.tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--bg-tertiary);
    border-radius: 20px;
    font-size: 12px;
    color: var(--text-primary);
}

.tag .remove-tag {
    width: 14px;
    height: 14px;
    cursor: pointer;
    color: var(--text-muted);
    transition: var(--transition-fast);
}

.tag .remove-tag:hover {
    color: var(--accent-danger);
}

.tag-input-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}

.tag-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 13px;
}

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

/* Collections */
.collection-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--accent-primary);
    border-radius: 20px;
    font-size: 12px;
    color: white;
}

.collection-badge .remove {
    cursor: pointer;
    opacity: 0.7;
}

.collection-badge .remove:hover {
    opacity: 1;
}

/* Versions */
.version-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.version-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
}

.version-info {
    display: flex;
    flex-direction: column;
}

.version-name {
    font-size: 13px;
    font-weight: 500;
}

.version-meta {
    font-size: 11px;
    color: var(--text-muted);
}

.version-size {
    font-size: 12px;
    color: var(--text-secondary);
}

/* Detail Footer */
.detail-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

/* ========================================
   Content Views
   ======================================== */
.content-view {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.content-view.hidden {
    display: none !important;
}

/* ========================================
   Dashboard
   ======================================== */
.dashboard {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.dashboard-header {
    margin-bottom: 24px;
}

.dashboard-title {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 4px;
}

.dashboard-subtitle {
    color: var(--text-secondary);
}

/* Stats Cards */
.stats-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 32px;
}

@media (max-width: 1200px) {
    .stats-cards {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .stats-cards {
        grid-template-columns: 1fr;
    }
}

.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon svg {
    width: 24px;
    height: 24px;
    color: white;
}

.stat-icon.blue {
    background: linear-gradient(135deg, #1da1f2, #0d8bd9);
}

.stat-icon.green {
    background: linear-gradient(135deg, #17bf63, #14a857);
}

.stat-icon.purple {
    background: linear-gradient(135deg, #7856ff, #6642e6);
}

.stat-icon.orange {
    background: linear-gradient(135deg, #ffad1f, #f59e0b);
}

.stat-info {
    flex: 1;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.stat-unit {
    font-size: 14px;
    font-weight: 400;
    color: var(--text-muted);
    margin-left: 4px;
}

/* Dashboard Sections */
.dashboard-section {
    margin-bottom: 32px;
}

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

.section-header h2 {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}

.link-btn {
    color: var(--accent-primary);
    font-size: 13px;
    text-decoration: none;
}

.link-btn:hover {
    text-decoration: underline;
}

/* Recent Assets Grid */
.recent-assets-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.recent-assets-grid .asset-card {
    width: 200px;
    flex-shrink: 0;
}

/* Responsive for recent assets */
@media (max-width: 768px) {
    .recent-assets-grid .asset-card {
        width: calc(50% - 8px);
    }
}

@media (max-width: 480px) {
    .recent-assets-grid .asset-card {
        width: 100%;
    }
}

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

.section-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
}

.recent-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
}

/* Dashboard Charts */
.dashboard-charts {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

@media (max-width: 900px) {
    .dashboard-charts {
        grid-template-columns: 1fr;
    }
}

.charts-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 24px;
}

.chart-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
}

.chart-card h3 {
    font-size: 15px;
    font-weight: 600;
    margin: 0 0 20px 0;
}

.chart-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 16px;
}

.chart-container {
    min-height: 150px;
}

.chart-bars {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chart-bar {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chart-bar-label {
    width: 80px;
    font-size: 12px;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.chart-bar-track {
    flex: 1;
    height: 24px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.chart-bar-fill {
    height: 100%;
    background: var(--accent-primary);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 8px;
    min-width: 30px;
    transition: width 0.5s ease;
}

.chart-bar-value {
    font-size: 11px;
    font-weight: 600;
    color: white;
}

.chart-bar-label {
    width: 80px;
    font-size: 12px;
    color: var(--text-secondary);
    text-align: right;
}

.chart-bar-track {
    flex: 1;
    height: 24px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    overflow: hidden;
}

.chart-bar-fill {
    height: 100%;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 8px;
    font-size: 11px;
    font-weight: 500;
    color: white;
    min-width: 30px;
}

.chart-bar-fill.blue { background: var(--accent-primary); }
.chart-bar-fill.green { background: var(--accent-secondary); }
.chart-bar-fill.yellow { background: var(--accent-warning); }
.chart-bar-fill.red { background: var(--accent-danger); }
.chart-bar-fill.purple { background: var(--accent-purple); }

/* ========================================
   Buttons
   ======================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-fast);
    white-space: nowrap;
    flex-shrink: 0;
}

.btn svg {
    width: 18px;
    height: 18px;
}

.btn-primary {
    background: var(--accent-primary);
    color: white;
}

.btn-primary:hover {
    background: #1a91da;
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

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

.btn-danger {
    background: var(--accent-danger);
    color: white;
}

.btn-danger:hover {
    background: #c91d52;
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
}

.btn-ghost:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-sm svg {
    width: 14px;
    height: 14px;
}

.btn-success {
    background: var(--accent-success);
    color: white;
    border-color: var(--accent-success);
}

.btn-success:hover {
    background: var(--accent-success);
    opacity: 0.9;
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
}

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

.btn-icon svg {
    width: 20px;
    height: 20px;
}

.btn-icon.danger:hover {
    color: var(--accent-danger);
}

.btn-icon.active {
    color: var(--accent-warning);
}

/* ========================================
   Modals
   ======================================== */
.modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal.open {
    display: flex;
}

.modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.modal-lg {
    max-width: 800px;
}

.modal-sm {
    max-width: 400px;
}

.modal-xl {
    max-width: 1100px;
}

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

.modal-title {
    font-size: 18px;
    font-weight: 600;
}

.modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: var(--radius-sm);
    font-size: 24px;
    transition: var(--transition-fast);
}

.modal-close:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    max-height: calc(90vh - 140px);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
}

.modal-footer .btn {
    flex-shrink: 0;
    white-space: nowrap;
    font-size: 14px !important;
    padding: 10px 18px !important;
    min-width: auto;
    max-width: 150px;
}

/* Modal Tabs */
.modal-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    padding: 0 24px;
}

.modal-tab {
    padding: 16px 20px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    position: relative;
    transition: var(--transition-fast);
}

.modal-tab:hover {
    color: var(--text-primary);
}

.modal-tab.active {
    color: var(--accent-primary);
}

.modal-tab.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--accent-primary);
}

/* ========================================
   Forms
   ======================================== */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="number"],
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    outline: none;
    transition: var(--transition-fast);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-muted);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(29, 161, 242, 0.1);
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.form-control,
.form-input {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    outline: none;
    transition: var(--transition-fast);
}

.form-control::placeholder,
.form-input::placeholder {
    color: var(--text-muted);
}

.form-control:focus,
.form-input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(29, 161, 242, 0.1);
}

.form-control-static {
    padding: 10px 0;
    color: var(--text-secondary);
    font-size: 13px;
    word-break: break-all;
}

/* Read-only inputs */
.form-control[readonly],
.form-input[readonly] {
    background-color: var(--bg-tertiary);
    cursor: default;
    opacity: 0.8;
}

.form-control[readonly]:focus,
.form-input[readonly]:focus {
    border-color: var(--border-color);
    box-shadow: none;
}

.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238899a6' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
    cursor: pointer;
}

.form-textarea {
    resize: vertical;
    min-height: 100px;
}

.form-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 6px;
}

/* Toggle Switch */
.toggle-switch-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    transition: 0.3s;
    border-radius: 26px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 2px;
    bottom: 2px;
    background-color: var(--text-muted);
    transition: 0.3s;
    border-radius: 50%;
}

.toggle-switch input:checked + .toggle-slider {
    background-color: var(--accent-primary);
    border-color: var(--accent-primary);
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(22px);
    background-color: white;
}

.toggle-label {
    font-size: 14px;
    color: var(--text-primary);
}

/* Validity Badge (for non-admin users) */
.validity-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 13px;
    color: var(--text-secondary);
}

.validity-badge svg {
    color: var(--accent-warning);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* User Info Card (in edit user modal) */
.user-info-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    margin-bottom: 20px;
}

.user-info-details {
    flex: 1;
}

.user-info-email {
    font-size: 14px;
    color: var(--text-secondary);
}

/* ========================================
   Permissions Modal
   ======================================== */
.permissions-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.permission-section {
    background: var(--bg-tertiary);
    border-radius: var(--radius-lg);
    padding: 20px;
}

.permission-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 16px;
}

.permission-title.allow {
    color: var(--accent-secondary);
}

.permission-title.deny {
    color: var(--accent-danger);
}

.permission-search {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    margin-bottom: 12px;
    outline: none;
}

.permission-search:focus {
    border-color: var(--accent-primary);
}

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

.permission-list {
    min-height: 150px;
}

.permission-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    margin-bottom: 8px;
}

.permission-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--accent-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 12px;
    font-weight: 600;
}

.permission-name {
    flex: 1;
    font-size: 13px;
}

.permission-remove {
    color: var(--text-muted);
    cursor: pointer;
}

.permission-remove:hover {
    color: var(--accent-danger);
}

/* ========================================
   Users & Groups
   ======================================== */
.user-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.user-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-lg);
}

.user-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-avatar .initials {
    width: 100%;
    height: 100%;
    background: var(--accent-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 18px;
}

.user-info {
    flex: 1;
    min-width: 0;
}

.user-name {
    font-weight: 500;
    margin-bottom: 2px;
}

.user-email {
    font-size: 12px;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-role {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 500;
    border: 1px solid;
}

.user-role.admin {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.user-role.user {
    border-color: var(--border-color);
    color: var(--text-secondary);
}

.user-actions {
    display: flex;
    gap: 8px;
}

/* ========================================
   Context Menu
   ======================================== */
.context-menu {
    position: fixed;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    min-width: 180px;
    z-index: 2000;
    display: none;
    padding: 6px 0;
}

.context-menu.open {
    display: block;
}

.context-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    cursor: pointer;
    transition: var(--transition-fast);
    color: var(--text-primary);
}

.context-menu-item:hover {
    background: var(--bg-hover);
}

.context-menu-item svg {
    width: 16px;
    height: 16px;
    color: var(--text-secondary);
}

.context-menu-item.danger {
    color: var(--accent-danger);
}

.context-menu-item.danger svg {
    color: var(--accent-danger);
}

.context-menu-divider {
    height: 1px;
    background: var(--border-color);
    margin: 4px 0;
}

/* ========================================
   Toast Notifications
   ======================================== */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    animation: slideIn 0.3s ease;
    min-width: 300px;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast.success {
    border-left: 3px solid var(--accent-secondary);
}

.toast.error {
    border-left: 3px solid var(--accent-danger);
}

.toast.warning {
    border-left: 3px solid var(--accent-warning);
}

.toast-message {
    flex: 1;
    font-size: 13px;
}

.toast-close {
    color: var(--text-muted);
    cursor: pointer;
    background: none;
    border: none;
    padding: 4px;
}

.toast-close:hover {
    color: var(--text-primary);
}

/* ========================================
   Empty States
   ======================================== */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
    color: var(--text-muted);
}

.empty-state svg {
    width: 80px;
    height: 80px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state p {
    font-size: 14px;
    margin-bottom: 20px;
}

.empty-actions {
    display: flex;
    gap: 12px;
}

/* ========================================
   Loading
   ======================================== */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ========================================
   Login View
   ======================================== */
#login-view {
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-container {
    width: 100%;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-box {
    width: 100%;
    max-width: 400px;
    padding: 40px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-purple));
    border-radius: 50%;
    margin: 0 auto 20px;
}

.login-logo svg {
    width: 36px;
    height: 36px;
    color: white;
}

.login-header h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.login-header p {
    color: var(--text-secondary);
    font-size: 14px;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.login-form .form-group {
    margin-bottom: 0;
}

.login-form .form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.login-form .form-group input {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
    transition: var(--transition-fast);
}

.login-form .form-group input::placeholder {
    color: var(--text-muted);
}

.login-form .form-group input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(29, 161, 242, 0.15);
}

.form-error {
    padding: 12px 16px;
    background: rgba(224, 36, 94, 0.1);
    border: 1px solid var(--accent-danger);
    border-radius: var(--radius-md);
    color: var(--accent-danger);
    font-size: 13px;
    display: none;
}

.form-error:not(:empty) {
    display: block;
}

.btn-block {
    width: 100%;
    padding: 14px 20px;
    font-size: 15px;
    font-weight: 600;
}

/* ========================================
   Upload Modal
   ======================================== */
.upload-area {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-lg);
    padding: 40px;
    text-align: center;
    transition: var(--transition-fast);
    cursor: pointer;
}

.upload-area:hover,
.upload-area.dragover {
    border-color: var(--accent-primary);
    background: rgba(29, 161, 242, 0.05);
}

.upload-area svg {
    width: 48px;
    height: 48px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.upload-area p {
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.upload-area span {
    font-size: 12px;
    color: var(--text-muted);
}

.upload-list {
    margin-top: 20px;
    max-height: 200px;
    overflow-y: auto;
}

.upload-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    margin-bottom: 8px;
}

.upload-item-icon {
    width: 40px;
    height: 40px;
    background: var(--bg-hover);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}

.upload-item-icon svg {
    width: 20px;
    height: 20px;
    color: var(--text-muted);
}

.upload-item-info {
    flex: 1;
    min-width: 0;
}

.upload-item-name {
    font-size: 13px;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.upload-item-size {
    font-size: 11px;
    color: var(--text-muted);
}

.upload-item-progress {
    width: 100%;
    height: 4px;
    background: var(--bg-hover);
    border-radius: 2px;
    margin-top: 6px;
    overflow: hidden;
}

.upload-item-progress-bar {
    height: 100%;
    background: var(--accent-primary);
    border-radius: 2px;
    transition: width 0.3s ease;
}

.upload-item-remove {
    color: var(--text-muted);
    cursor: pointer;
}

.upload-item-remove:hover {
    color: var(--accent-danger);
}

/* ========================================
   Tab Content
   ======================================== */
.tab-content {
    display: none;
    flex: 1;
    flex-direction: column;
    overflow: hidden;
}

.tab-content.active {
    display: flex;
}

/* ========================================
   Super Admin Panel
   ======================================== */
.admin-container {
    display: flex;
    height: calc(100vh - 60px);
    overflow: hidden;
}

.admin-sidebar {
    width: 220px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    padding: 20px 0;
    flex-shrink: 0;
}

.admin-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 0 12px;
}

.admin-nav .nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    transition: all 0.15s ease;
}

.admin-nav .nav-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.admin-nav .nav-item.active {
    background: var(--accent-primary);
    color: white;
}

.admin-nav .nav-item svg {
    flex-shrink: 0;
}

.admin-content {
    flex: 1;
    overflow-y: auto;
    padding: 24px 32px;
    background: var(--bg-primary);
}

.admin-section {
    max-width: 1200px;
}

.admin-section h2 {
    font-size: 24px;
    font-weight: 600;
    margin: 0 0 24px 0;
    color: var(--text-primary);
}

.admin-section h3 {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 16px 0;
    color: var(--text-primary);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.section-header h2 {
    margin: 0;
}

/* Stats Cards in Admin */
#admin-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

#admin-stats .stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
}

#admin-stats .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

#admin-stats .stat-icon.blue { background: rgba(29, 161, 242, 0.1); color: #1da1f2; }
#admin-stats .stat-icon.purple { background: rgba(136, 84, 208, 0.1); color: #8854d0; }
#admin-stats .stat-icon.green { background: rgba(32, 201, 151, 0.1); color: #20c997; }
#admin-stats .stat-icon.orange { background: rgba(253, 126, 20, 0.1); color: #fd7e14; }

#admin-stats .stat-info {
    flex: 1;
}

#admin-stats .stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

#admin-stats .stat-label {
    font-size: 13px;
    color: var(--text-tertiary);
    margin-top: 4px;
}

/* Recent Tenants */
.recent-tenants {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
}

/* Tenant List Item */
.tenant-list-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    margin-bottom: 12px;
}

.tenant-list-item:last-child {
    margin-bottom: 0;
}

.tenant-info {
    flex: 1;
    min-width: 0;
}

.tenant-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.tenant-slug {
    font-size: 12px;
    color: var(--text-tertiary);
}

.tenant-created {
    font-size: 12px;
    color: var(--text-tertiary);
}

.tenant-stats {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: var(--text-secondary);
}

.tenant-stats span {
    white-space: nowrap;
}

.tenant-actions {
    display: flex;
    gap: 8px;
}

/* Status Badge */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 600;
    border-radius: var(--radius-full);
    text-transform: uppercase;
}

.status-badge.active {
    background: rgba(32, 201, 151, 0.15);
    color: #20c997;
}

.status-badge.suspended {
    background: rgba(253, 126, 20, 0.15);
    color: #fd7e14;
}

.status-badge.deleted {
    background: rgba(220, 53, 69, 0.15);
    color: #dc3545;
}

/* Tenants List Container */
.tenants-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Super Admins List */
.superadmins-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

/* Tenant Stats Modal */
.tenant-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.tenant-stats-grid .stat-card {
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.tenant-stats-grid .stat-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
}

.tenant-stats-grid .stat-icon.blue { background: rgba(29, 161, 242, 0.15); color: #1da1f2; }
.tenant-stats-grid .stat-icon.green { background: rgba(32, 201, 151, 0.15); color: #20c997; }
.tenant-stats-grid .stat-icon.purple { background: rgba(136, 84, 208, 0.15); color: #8854d0; }
.tenant-stats-grid .stat-icon.orange { background: rgba(253, 126, 20, 0.15); color: #fd7e14; }

.tenant-stats-grid .stat-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

.tenant-stats-grid .stat-label {
    font-size: 12px;
    color: var(--text-tertiary);
}

/* Storage Bar */
.storage-bar-container {
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 24px;
}

.storage-bar-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 500;
}

.storage-bar {
    height: 8px;
    background: var(--bg-secondary);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.storage-bar-fill {
    height: 100%;
    background: var(--accent-primary);
    border-radius: var(--radius-full);
    transition: width 0.3s ease;
}

.storage-bar-fill.warning {
    background: #fd7e14;
}

.storage-bar-fill.danger {
    background: #dc3545;
}

.storage-bar-info {
    margin-top: 8px;
    font-size: 12px;
    color: var(--text-tertiary);
}

/* Tenant Users Section */
.tenant-users-section {
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    padding: 16px;
}

.tenant-users-section h4 {
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 12px 0;
    color: var(--text-primary);
}

.tenant-users-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 300px;
    overflow-y: auto;
}

.tenant-user-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    background: var(--bg-card);
    border-radius: var(--radius-md);
}

.tenant-user-item .user-info {
    flex: 1;
    min-width: 0;
}

.tenant-user-item .user-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.tenant-user-item .user-email {
    font-size: 12px;
    color: var(--text-tertiary);
}

/* Loading Spinner */
.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 40px auto;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Delete Stats List */
.delete-stats-list {
    list-style: none;
    padding: 0;
    margin: 12px 0;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    padding: 12px 16px;
}

.delete-stats-list li {
    padding: 6px 0;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
}

.delete-stats-list li:last-child {
    border-bottom: none;
}

.delete-stats-list strong {
    color: var(--text-primary);
}

/* ========================================
   Settings Tabs
   ======================================== */
.settings-tabs {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
}

.settings-tab {
    padding: 12px 20px;
    background: none;
    border: none;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: all 0.2s ease;
}

.settings-tab:hover {
    color: var(--text-primary);
}

.settings-tab.active {
    color: var(--accent-primary);
    border-bottom-color: var(--accent-primary);
}

.settings-tab-content {
    display: none;
}

.settings-tab-content.active {
    display: block;
}

/* Logo Upload */
.logo-upload-container {
    display: flex;
    align-items: center;
    gap: 20px;
}

.logo-preview {
    width: 200px;
    height: 60px;
    background: var(--bg-tertiary);
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.logo-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.logo-preview .no-logo {
    font-size: 12px;
    color: var(--text-muted);
}

.logo-upload-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Form helpers */
.flex-2 {
    flex: 2;
}

.form-actions {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

/* ========================================
   Admin List (for Taxonomies, Tags, etc)
   ======================================== */
.admin-list {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow-y: auto;
}

.admin-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 16px;
}

.admin-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.admin-card-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.admin-card-title h3 {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
}

.admin-card-actions {
    display: flex;
    gap: 8px;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 500;
    border-radius: 20px;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

.badge-primary {
    background: var(--accent-primary);
    color: white;
}

/* ========================================
   Tags Input & Autocomplete
   ======================================== */
.tags-input {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    min-height: 44px;
    position: relative;
}

.tags-input:focus-within {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(29, 161, 242, 0.1);
}

.tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tag-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: var(--accent-primary);
    color: white;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 500;
}

.tag-badge button {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    color: white;
    opacity: 0.7;
    display: flex;
}

.tag-badge button:hover {
    opacity: 1;
}

.tag-input {
    flex: 1;
    min-width: 100px;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 14px;
}

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

.tag-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    margin-top: 4px;
    z-index: 100;
    max-height: 200px;
    overflow-y: auto;
}

.tag-suggestion {
    padding: 10px 14px;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-primary);
    transition: var(--transition-fast);
}

.tag-suggestion:hover {
    background: var(--bg-hover);
}

.tag-suggestion.new {
    color: var(--accent-primary);
    font-style: italic;
}

/* ========================================
   Upload Items Enhanced
   ======================================== */
.upload-zone {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-lg);
    padding: 48px 24px;
    text-align: center;
    transition: var(--transition-fast);
    cursor: pointer;
    background: var(--bg-tertiary);
}

.upload-zone:hover,
.upload-zone.dragover {
    border-color: var(--accent-primary);
    background: rgba(29, 161, 242, 0.05);
}

.upload-zone svg {
    color: var(--text-muted);
    margin-bottom: 16px;
}

.upload-zone p {
    color: var(--text-secondary);
    margin: 0;
}

.upload-zone .link {
    color: var(--accent-primary);
    cursor: pointer;
}

.upload-zone input[type="file"] {
    display: none;
}

.upload-list {
    margin-top: 20px;
    max-height: 300px;
    overflow-y: auto;
}

.upload-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    margin-bottom: 8px;
    position: relative;
}

.upload-item.uploading {
    opacity: 0.7;
}

.upload-item.completed {
    border-left: 3px solid var(--accent-success);
}

.upload-item.error {
    border-left: 3px solid var(--accent-danger);
}

.upload-item .upload-select {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.upload-item-preview {
    width: 48px;
    height: 48px;
    background: var(--bg-hover);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

.upload-item-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.upload-item-preview svg {
    width: 24px;
    height: 24px;
    color: var(--text-muted);
}

.upload-item-info {
    flex: 1;
    min-width: 0;
}

.upload-item-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.upload-item-size {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

.upload-item-title {
    margin-top: 8px;
    padding: 6px 10px !important;
    font-size: 12px !important;
}

.upload-item-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--bg-hover);
    border-radius: 0 0 var(--radius-md) var(--radius-md);
}

.upload-item-progress .progress-bar {
    height: 100%;
    background: var(--accent-primary);
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    transition: width 0.3s ease;
    width: 0;
}

.upload-item-remove {
    opacity: 0.6;
}

.upload-item-remove:hover {
    opacity: 1;
}

/* Batch selection for uploads */
.upload-batch-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 16px 0;
    padding: 16px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
}

.batch-actions-row {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: center;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    cursor: pointer;
    white-space: nowrap;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
}

.batch-folder-select,
.batch-title-input {
    display: flex;
    align-items: center;
    gap: 8px;
}

.batch-folder-select label,
.batch-title-input label {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
}

.batch-folder-select select,
.batch-title-input input {
    padding: 6px 10px;
    font-size: 12px;
    min-width: 150px;
}

.batch-title-input button {
    white-space: nowrap;
}

/* Metadata toggle button */
.batch-metadata-toggle {
    border-top: 1px solid var(--border-color);
    padding-top: 12px;
    margin-top: 4px;
}

.batch-metadata-toggle button {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-secondary);
}

.batch-metadata-toggle button svg {
    transition: transform 0.2s ease;
}

.batch-metadata-toggle button.open svg {
    transform: rotate(180deg);
}

/* Metadata section */
.batch-metadata-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
    margin-top: 8px;
}

.batch-metadata-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.batch-metadata-group > label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
}

.batch-metadata-group > label svg {
    color: var(--text-muted);
}

/* Batch tags */
.batch-tags-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.batch-tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.batch-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: var(--accent-primary);
    color: white;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 500;
}

.batch-tag button {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    padding: 0;
    font-size: 14px;
    line-height: 1;
    opacity: 0.8;
}

.batch-tag button:hover {
    opacity: 1;
}

.batch-tags-input-wrapper {
    position: relative;
}

.batch-tags-input-wrapper input {
    width: 100%;
}

.batch-tags-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    max-height: 200px;
    overflow-y: auto;
    z-index: 100;
}

.batch-tags-dropdown-item {
    padding: 10px 12px;
    cursor: pointer;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.batch-tags-dropdown-item:hover {
    background: var(--bg-hover);
}

.batch-tags-dropdown-item.create-new {
    color: var(--accent-primary);
    border-top: 1px solid var(--border-color);
}

.batch-tags-dropdown-item .tag-color {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

/* Batch taxonomy terms (autocomplete multi-select like tags) */
.batch-terms-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.batch-terms-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.batch-term {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: var(--accent-secondary, #8854d0);
    color: white;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 500;
}

.batch-term .term-taxonomy {
    opacity: 0.7;
    font-size: 10px;
}

.batch-term button {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    padding: 0;
    font-size: 14px;
    line-height: 1;
    opacity: 0.8;
}

.batch-term button:hover {
    opacity: 1;
}

.batch-terms-input-wrapper {
    position: relative;
}

.batch-terms-input-wrapper input {
    width: 100%;
}

.batch-terms-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    max-height: 250px;
    overflow-y: auto;
    z-index: 100;
}

.batch-terms-dropdown-group {
    padding: 8px 12px 4px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-top: 1px solid var(--border-color);
}

.batch-terms-dropdown-group:first-child {
    border-top: none;
}

.batch-terms-dropdown-item {
    padding: 10px 12px;
    cursor: pointer;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.batch-terms-dropdown-item:hover {
    background: var(--bg-hover);
}

.batch-terms-dropdown-item .term-name {
    flex: 1;
}

/* Batch visibility dates */
.batch-visibility-dates {
    display: flex;
    gap: 16px;
}

.batch-visibility-dates .date-field {
    display: flex;
    align-items: center;
    gap: 8px;
}

.batch-visibility-dates .date-field label {
    font-size: 12px;
    color: var(--text-muted);
}

.batch-visibility-dates .date-field input {
    padding: 8px 12px;
    font-size: 13px;
    width: 160px;
}

.upload-count {
    font-size: 13px;
    color: var(--text-muted);
    margin-right: auto;
}

/* ========================================
   Taxonomy Tree Enhanced
   ======================================== */
.taxonomy-item {
    margin-bottom: 4px;
}

.taxonomy-header {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 10px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition-fast);
}

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

.taxonomy-toggle {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    display: flex;
    color: var(--text-muted);
    transition: transform 0.2s ease;
}

.taxonomy-item.expanded .taxonomy-toggle {
    transform: rotate(90deg);
}

.taxonomy-name {
    flex: 1;
    font-size: 13px;
    color: var(--text-primary);
}

.taxonomy-edit {
    opacity: 0;
    transition: var(--transition-fast);
}

.taxonomy-header:hover .taxonomy-edit {
    opacity: 1;
}

.taxonomy-values {
    padding-left: 28px;
    overflow: hidden;
    max-height: 500px;
    transition: max-height 0.3s ease;
}

.taxonomy-values.collapsed {
    max-height: 0;
}

.taxonomy-value {
    padding: 6px 10px;
    font-size: 12px;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
}

.taxonomy-value:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

/* Taxonomy modal values */
.taxonomy-value-item {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.taxonomy-value-item input {
    flex: 1;
}

.taxonomy-value-item button {
    opacity: 0.6;
}

.taxonomy-value-item button:hover {
    opacity: 1;
}

.add-value-row {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.add-value-row input {
    flex: 1;
}

/* ========================================
   Collections Select
   ======================================== */
.collections-select {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 150px;
    overflow-y: auto;
    padding: 10px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
}

.collections-select label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    cursor: pointer;
}

.collections-select label:hover {
    color: var(--accent-primary);
}

/* ========================================
   Folder Select Tree (Move Modal)
   ======================================== */
.folder-select-tree {
    max-height: 300px;
    overflow-y: auto;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    padding: 8px;
}

.folder-select-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 13px;
    color: var(--text-primary);
    transition: var(--transition-fast);
}

.folder-select-item:hover {
    background: var(--bg-hover);
}

.folder-select-item.selected {
    background: var(--accent-primary);
    color: white;
}

.folder-select-item svg {
    width: 18px;
    height: 18px;
    color: var(--text-muted);
    flex-shrink: 0;
}

.folder-select-item.selected svg {
    color: white;
}

/* ========================================
   Detail Panel (Right Side Panel - NOT Modal)
   ======================================== */
.asset-browser .detail-panel {
    width: var(--detail-panel-width, 380px);
    min-width: var(--detail-panel-width, 380px);
    max-width: var(--detail-panel-width, 380px);
    background: var(--bg-secondary);
    border-left: 1px solid var(--border-color);
    display: none;
    flex-direction: column;
    flex-shrink: 0;
    overflow: hidden;
    height: auto;
    position: relative;
}

.asset-browser .detail-panel.open {
    display: flex;
}

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

.detail-panel-header h3 {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
}

.detail-panel-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.detail-form .form-group {
    margin-bottom: 16px;
}

.detail-panel-footer {
    display: flex;
    gap: 10px;
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
}

.detail-panel-footer .btn-secondary {
    flex: 0 0 auto;
}

.detail-panel-footer .btn-primary {
    flex: 1;
}

/* Versions list */
.versions-list {
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    padding: 10px;
    max-height: 150px;
    overflow-y: auto;
}

.version-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    font-size: 12px;
}

.version-item:hover {
    background: var(--bg-hover);
}

.version-item.current {
    background: rgba(29, 161, 242, 0.1);
}

.version-item-info {
    color: var(--text-secondary);
}

.version-item-date {
    color: var(--text-muted);
    font-size: 11px;
}

/* AI Generate Link */
.ai-generate-link {
    margin-top: 16px;
    text-align: center;
}

.ai-generate-link a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--accent-purple);
    font-size: 13px;
    text-decoration: none;
}

.ai-generate-link a:hover {
    text-decoration: underline;
}

/* Taxonomy select in detail panel */
.taxonomy-select-group {
    margin-bottom: 12px;
}

.taxonomy-select-group label {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.taxonomy-select-group select {
    width: 100%;
    min-height: 60px;
}

/* ========================================
   Responsive
   ======================================== */
@media (max-width: 1200px) {
    .asset-browser .detail-panel.open {
        position: fixed;
        right: 0;
        top: var(--header-height);
        bottom: 0;
        z-index: 500;
        width: 380px;
        max-width: 90vw;
        box-shadow: -4px 0 20px rgba(0, 0, 0, 0.3);
    }
}

@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: -100%;
        top: var(--header-height);
        bottom: 0;
        z-index: 500;
        transition: left var(--transition-normal);
    }

    .sidebar.open {
        left: 0;
    }

    .header-search {
        display: none;
    }

    .charts-row {
        grid-template-columns: 1fr;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .permissions-grid {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   Lightbox - HIDDEN by default
   ======================================== */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.lightbox.open {
    display: flex;
    opacity: 1;
    visibility: visible;
}

/* Lightbox header */
.lightbox-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background: linear-gradient(to bottom, rgba(0,0,0,0.6), transparent);
    z-index: 10001;
}

.lightbox-close {
    background: transparent;
    border: none;
    color: white;
    font-size: 32px;
    cursor: pointer;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.1);
}

.lightbox-download-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    color: white;
    background: rgba(255, 255, 255, 0.1);
    transition: background 0.2s;
}

.lightbox-download-btn:hover {
    background: var(--accent-primary);
    color: white;
    text-decoration: none;
}

.lightbox-prev,
.lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
    z-index: 10001;
}

.lightbox-prev {
    left: 20px;
}

.lightbox-next {
    right: 20px;
}

.lightbox-prev:hover,
.lightbox-next:hover {
    background: rgba(255, 255, 255, 0.2);
}

.lightbox-content {
    max-width: 90vw;
    max-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
}

/* Video player */
.lightbox-video {
    max-width: 90vw;
    max-height: 80vh;
    background: #000;
    border-radius: 8px;
}

/* Audio player */
.lightbox-audio-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
    padding: 40px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
}

.lightbox-audio-container .audio-icon {
    color: var(--accent-primary);
}

.lightbox-audio {
    width: 400px;
    max-width: 90vw;
}

/* PDF viewer */
.lightbox-pdf {
    width: 90vw;
    height: 85vh;
    border: none;
    border-radius: 8px;
    background: white;
}

/* Unsupported file type */
.lightbox-unsupported {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    padding: 40px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    text-align: center;
}

.lightbox-unsupported .file-icon-large svg {
    width: 80px;
    height: 80px;
    color: var(--text-muted);
}

.lightbox-unsupported p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 16px;
}

.lightbox-unsupported .btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* Download button */
.lightbox-download {
    position: absolute;
    bottom: 20px;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-size: 14px;
    transition: background 0.2s;
}

.lightbox-download:hover {
    background: rgba(255, 255, 255, 0.2);
    text-decoration: none;
}

.lightbox-info {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    color: white;
}

.lightbox-title {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 4px;
}

.lightbox-meta {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
}

/* Lightbox expandable details panel */
.lightbox-details {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.9), rgba(0,0,0,0.7));
    z-index: 10001;
    display: none;
}

.lightbox.user-mode .lightbox-details {
    display: block;
}

.lightbox.user-mode .lightbox-info,
.lightbox.user-mode .lightbox-download {
    display: none;
}

.lightbox-details-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    background: transparent;
    border: none;
    color: white;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s;
}

.lightbox-details-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
}

.lightbox-details-toggle .toggle-arrow {
    transition: transform 0.3s;
}

.lightbox-details.expanded .lightbox-details-toggle .toggle-arrow {
    transform: rotate(180deg);
}

.lightbox-details-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    padding: 0 20px;
}

.lightbox-details.expanded .lightbox-details-content {
    max-height: 400px;
    padding: 0 20px 20px;
}

.lightbox-detail-item {
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.lightbox-detail-item:last-child {
    border-bottom: none;
}

.lightbox-detail-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 4px;
}

.lightbox-detail-value {
    font-size: 14px;
    color: white;
}

.lightbox-detail-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.lightbox-detail-tag {
    display: inline-block;
    padding: 4px 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.9);
}

.lightbox-detail-taxonomy {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.8);
}

.lightbox-detail-taxonomy .tax-separator {
    color: rgba(255, 255, 255, 0.4);
}

.lightbox-validity-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(23, 191, 99, 0.2);
    color: #17bf63;
    border-radius: 6px;
    font-size: 13px;
}

.lightbox-validity-badge.expired {
    background: rgba(224, 36, 94, 0.2);
    color: #e0245e;
}

.lightbox-validity-badge.scheduled {
    background: rgba(255, 173, 31, 0.2);
    color: #ffad1f;
}

/* Mobile lightbox */
@media (max-width: 768px) {
    .lightbox-header {
        padding: 10px 15px;
    }

    .lightbox-close,
    .lightbox-download-btn {
        width: 40px;
        height: 40px;
    }

    .lightbox-prev,
    .lightbox-next {
        width: 40px;
        height: 40px;
    }

    .lightbox-prev {
        left: 10px;
    }

    .lightbox-next {
        right: 10px;
    }

    .lightbox-content {
        max-width: 100vw;
        max-height: 70vh;
    }

    .lightbox-content img {
        max-height: 70vh;
    }

    .lightbox-details-content {
        padding: 0 15px;
    }

    .lightbox-details.expanded .lightbox-details-content {
        padding: 0 15px 15px;
        max-height: 50vh;
        overflow-y: auto;
    }

    /* Mobile asset grid - 2 columns */
    .assets-grid {
        gap: 10px;
    }

    .asset-card {
        width: calc(50% - 5px);
    }

    .asset-card-thumb,
    .asset-card-preview {
        width: 100%;
        height: 100px;
    }

    .asset-card-info {
        padding: 8px;
    }

    .asset-card-name {
        font-size: 12px;
    }

    /* Mobile folders grid */
    .folders-grid {
        gap: 10px;
    }

    .folder-card {
        width: calc(50% - 5px);
        padding: 12px;
    }

    .folder-card-icon svg {
        width: 32px;
        height: 32px;
    }

    .folder-card-name {
        font-size: 12px;
    }

    /* Stats cards mobile */
    .stats-row {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .stat-card {
        padding: 12px;
    }

    .stat-value {
        font-size: 20px;
    }

    /* Hide favorite button on mobile - touch interaction preferred */
    .asset-card .favorite-btn {
        opacity: 1;
        width: 32px;
        height: 32px;
    }
}

/* Extra small screens */
@media (max-width: 480px) {
    .lightbox-header {
        padding: 8px 12px;
    }

    .lightbox-close,
    .lightbox-download-btn {
        width: 36px;
        height: 36px;
    }

    .lightbox-close {
        font-size: 24px;
    }

    .lightbox-prev,
    .lightbox-next {
        width: 36px;
        height: 36px;
    }

    .lightbox-details-toggle {
        padding: 10px;
        font-size: 13px;
    }

    .lightbox-detail-item {
        padding: 8px 0;
    }

    .lightbox-detail-label {
        font-size: 10px;
    }

    .lightbox-detail-value {
        font-size: 13px;
    }
}

/* ========================================
   Modal Form Inputs - Dark Theme
   ======================================== */
.modal input[type="text"],
.modal input[type="email"],
.modal input[type="password"],
.modal input[type="number"],
.modal input[type="url"],
.modal input[type="tel"],
.modal input[type="search"],
.modal textarea,
.modal select {
    background: var(--bg-tertiary) !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-primary) !important;
    border-radius: var(--radius-md);
    padding: 10px 12px;
    width: 100%;
    font-size: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.modal input[type="text"]:focus,
.modal input[type="email"]:focus,
.modal input[type="password"]:focus,
.modal input[type="number"]:focus,
.modal input[type="url"]:focus,
.modal input[type="tel"]:focus,
.modal input[type="search"]:focus,
.modal textarea:focus,
.modal select:focus {
    outline: none;
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.1);
}

.modal input::placeholder,
.modal textarea::placeholder {
    color: var(--text-muted);
}

.modal select option {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

/* ========================================
   Tabs
   ======================================== */
.tabs {
    display: flex;
    gap: 4px;
    padding: 0 24px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 24px;
}

.tab {
    padding: 12px 20px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    position: relative;
    transition: var(--transition-fast);
}

.tab:hover {
    color: var(--text-primary);
}

.tab.active {
    color: var(--accent-primary);
}

.tab.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--accent-primary);
    border-radius: 2px 2px 0 0;
}

#view-users .tab-content {
    padding: 24px;
    display: block;
}

#view-users .tab-content.hidden {
    display: none !important;
}

/* ========================================
   Users & Groups Page
   ======================================== */
#view-users .page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px;
    border-bottom: 1px solid var(--border-color);
}

#view-users .page-header h1 {
    font-size: 24px;
    font-weight: 600;
    margin: 0;
}

.page-actions {
    display: flex;
    gap: 12px;
}

/* Users Grid */
.users-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
}

.user-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    transition: var(--transition-fast);
    flex-wrap: wrap;
}

.user-card:hover {
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-md);
}

.user-card-info {
    flex: 1;
    min-width: 150px;
}

.user-card-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.user-card-name small {
    font-weight: 400;
    color: var(--text-muted);
    font-size: 12px;
}

.user-card-email {
    font-size: 13px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-card .role-badge {
    flex-shrink: 0;
}

.user-card-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    margin-left: auto;
}

/* Role Badge */
.role-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.role-badge.admin {
    background: linear-gradient(135deg, var(--accent-purple), #9333ea);
    color: white;
}

.role-badge.user {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

/* Groups Grid */
.groups-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.group-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    transition: var(--transition-fast);
}

.group-card:hover {
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-md);
}

.group-card-info {
    flex: 1;
    min-width: 0;
}

.group-card-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.group-card-count {
    font-size: 13px;
    color: var(--text-secondary);
}

.group-card-actions {
    flex-shrink: 0;
}

.avatar-group {
    background: linear-gradient(135deg, var(--accent-success), #059669);
}

.avatar-group svg {
    color: white;
}

.empty-section {
    padding: 40px;
    text-align: center;
    color: var(--text-muted);
    font-style: italic;
}

/* ========================================
   Tag Chips (in Detail Panel)
   ======================================== */
.tag-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: linear-gradient(135deg, var(--accent-primary), #0284c7);
    color: white;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 500;
}

.tag-chip .tag-remove {
    background: none;
    border: none;
    color: white;
    opacity: 0.7;
    cursor: pointer;
    padding: 0;
    font-size: 16px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    transition: var(--transition-fast);
}

.tag-chip .tag-remove:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.2);
}

/* ========================================
   User Autocomplete (for permissions)
   ======================================== */
.user-autocomplete {
    position: relative;
}

.user-autocomplete input {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
    transition: var(--transition-fast);
}

.user-autocomplete input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(29, 161, 242, 0.1);
}

.user-autocomplete input::placeholder {
    color: var(--text-muted);
}

.user-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    margin-top: 4px;
    z-index: 1000;
    max-height: 250px;
    overflow-y: auto;
    display: none;
}

.user-suggestions.open {
    display: block;
}

.user-suggestion {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    cursor: pointer;
    transition: var(--transition-fast);
}

.user-suggestion:hover {
    background: var(--bg-hover);
}

.user-suggestion .avatar {
    width: 32px;
    height: 32px;
    font-size: 12px;
}

.user-suggestion-info {
    flex: 1;
    min-width: 0;
}

.user-suggestion-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.user-suggestion-email {
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.no-results {
    padding: 16px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
}

/* Selected users list */
.selected-users {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.selected-user {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    font-size: 13px;
}

.selected-user .avatar {
    width: 24px;
    height: 24px;
    font-size: 10px;
}

.selected-user .remove-user {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0;
    display: flex;
    transition: var(--transition-fast);
}

.selected-user .remove-user:hover {
    color: var(--accent-danger);
}

/* ========================================
   Stats Page
   ======================================== */
#view-stats {
    padding: 24px;
}

#view-stats .page-header {
    margin-bottom: 24px;
}

#view-stats .page-header h1 {
    font-size: 24px;
    font-weight: 600;
    margin: 0;
}

/* ========================================
   Tags View
   ======================================== */
#view-tags .page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px;
    border-bottom: 1px solid var(--border-color);
}

#view-tags .page-header h1 {
    font-size: 24px;
    font-weight: 600;
    margin: 0;
}

.stats-dashboard {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

#stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.stats-charts-full {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
}

.stats-charts-full .chart-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
}

.stats-charts-full .chart-card h3 {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 16px 0;
}

.stats-charts-full .chart-card.large {
    grid-column: 1 / -1;
}

.user-stats-list,
.activity-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 300px;
    overflow-y: auto;
}

.user-stat-item,
.activity-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
}

.user-stat-item .avatar {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
}

.user-stat-info {
    flex: 1;
    min-width: 0;
}

.user-stat-name {
    font-weight: 500;
    margin-bottom: 2px;
}

.user-stat-value {
    font-size: 12px;
    color: var(--text-secondary);
}

.activity-item {
    font-size: 13px;
}

.activity-item .activity-time {
    font-size: 11px;
    color: var(--text-muted);
    margin-left: auto;
}

/* Autocomplete suggestion info */
.user-suggestion-info {
    flex: 1;
    min-width: 0;
}

.user-suggestion-name {
    font-weight: 500;
    margin-bottom: 2px;
}

.user-suggestion-type {
    font-size: 11px;
    color: var(--text-muted);
}

.no-results {
    padding: 16px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
}

/* Permissions column styles */
.permissions-column {
    background: var(--bg-tertiary);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    flex-direction: column;
    min-height: 400px;
    overflow: visible;
}

.permissions-column h4 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 16px;
}

.permissions-column.allow h4 {
    color: var(--accent-secondary);
}

.permissions-column.deny h4 {
    color: var(--accent-danger);
}

.permissions-list {
    flex: 1;
    min-height: 150px;
    max-height: 200px;
    overflow-y: auto;
    margin-bottom: 12px;
}

/* Permissions column add section */
.permissions-add {
    margin-top: auto;
}

.permissions-add.user-autocomplete {
    position: relative;
}

.permissions-add .user-suggestions {
    max-height: 200px;
    bottom: auto;
    top: 100%;
    margin-top: 4px;
    z-index: 100;
}

/* Allow suggestions to overflow the modal body */
#permissions-modal .modal-body {
    overflow: visible;
}

#permissions-modal .permissions-grid {
    overflow: visible;
}


/* ========================================
   Multi-Select & Batch Operations
   ======================================== */

/* Card Checkbox */
.card-checkbox {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 10;
    opacity: 0;
    transition: opacity 0.2s;
}

.folder-card:hover .card-checkbox,
.asset-card:hover .card-checkbox,
.folder-card.selected .card-checkbox,
.asset-card.selected .card-checkbox {
    opacity: 1;
}

.card-checkbox input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--accent-primary);
}

/* Selected state */
.folder-card.selected,
.asset-card.selected {
    outline: 2px solid var(--accent-primary);
    outline-offset: -2px;
}

.folder-card.selected .card-checkbox,
.asset-card.selected .card-checkbox {
    opacity: 1;
}

/* Folder card needs relative positioning */
.folder-card {
    position: relative;
}

/* Selection Toolbar */
.selection-toolbar {
    position: fixed;
    bottom: -80px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
    z-index: 1000;
    transition: bottom 0.3s ease;
}

.selection-toolbar.visible {
    bottom: 24px;
}

.selection-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.selection-count {
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
}

.selection-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.selection-actions .btn {
    display: flex;
    align-items: center;
    gap: 6px;
}

.selection-actions .btn svg {
    flex-shrink: 0;
}

/* Batch Modal Styles */
.modal-hint {
    color: var(--text-secondary);
    margin-bottom: 16px;
    font-size: 14px;
}

.batch-tags-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 300px;
    overflow-y: auto;
}

.batch-tag-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: var(--bg-tertiary);
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
}

.batch-tag-item:hover {
    background: var(--bg-hover);
}

.batch-tag-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent-primary);
}

.batch-tag-item .tag-color {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    flex-shrink: 0;
}

.batch-taxonomy-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.batch-taxonomy-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.batch-taxonomy-item label {
    font-weight: 500;
    color: var(--text-primary);
}

.batch-taxonomy-select {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 14px;
}

.batch-taxonomy-select:focus {
    outline: none;
    border-color: var(--accent-primary);
}

/* Batch Taxonomy Modal - autocomplete styling */
#batch-taxonomy-list .taxonomy-input-group {
    position: relative;
}

#batch-taxonomy-list .taxonomy-tokens {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
    min-height: 0;
}

#batch-taxonomy-list .taxonomy-token {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--accent-primary);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 13px;
}

#batch-taxonomy-list .token-remove {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 0;
    font-size: 16px;
    line-height: 1;
    opacity: 0.8;
}

#batch-taxonomy-list .token-remove:hover {
    opacity: 1;
}

#batch-taxonomy-list .taxonomy-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 100;
    display: none;
    margin-top: 4px;
}

#batch-taxonomy-list .taxonomy-suggestions.show {
    display: block;
}

#batch-taxonomy-list .taxonomy-suggestion {
    padding: 10px 12px;
    cursor: pointer;
    transition: background 0.2s;
}

#batch-taxonomy-list .taxonomy-suggestion:hover {
    background: var(--bg-hover);
}

#batch-taxonomy-list .no-suggestions {
    padding: 10px 12px;
    color: var(--text-muted);
    font-style: italic;
}

.batch-taxonomy-item {
    margin-bottom: 16px;
}

.batch-taxonomy-item label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-primary);
}

.batch-taxonomy-input {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 14px;
}

.batch-taxonomy-input:focus {
    outline: none;
    border-color: var(--accent-primary);
}

/* ========================================
   Dashboard Charts - Fixed
   ======================================== */
.chart-bar-item {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.chart-bar-item .chart-bar-label {
    width: 80px;
    font-size: 13px;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.chart-bar-wrapper {
    flex: 1;
    height: 28px;
    background: var(--bg-tertiary);
    border-radius: 6px;
    overflow: hidden;
    position: relative;
    display: flex;
    align-items: center;
}

.chart-bar-wrapper .chart-bar {
    height: 100%;
    background: var(--accent-primary);
    border-radius: 6px;
    min-width: 2px;
    transition: width 0.3s ease;
}

.chart-bar-wrapper .chart-bar.active {
    background: var(--accent-secondary);
}

.chart-bar-wrapper .chart-bar.inactive {
    background: var(--text-muted);
}

.chart-bar-wrapper .chart-bar.suspended {
    background: var(--accent-warning);
}

.chart-bar-wrapper .chart-bar.limbo {
    background: var(--accent-danger);
}

.chart-bar-wrapper .chart-bar-value {
    position: absolute;
    right: 10px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
}


/* ========================================
   Stats Page - Professional Dashboard
   ======================================== */

.stats-page {
    padding: 0;
}

.page-subtitle {
    color: var(--text-muted);
    font-size: 14px;
    margin-top: 4px;
}

/* Summary Cards Row */
.stats-summary-row {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card-large {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: var(--transition-fast);
}

.stat-card-large:hover {
    border-color: var(--accent-primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-card-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-card-icon.blue { background: rgba(29, 161, 242, 0.15); color: #1da1f2; }
.stat-card-icon.green { background: rgba(23, 191, 99, 0.15); color: #17bf63; }
.stat-card-icon.orange { background: rgba(255, 173, 31, 0.15); color: #ffad1f; }
.stat-card-icon.purple { background: rgba(121, 75, 196, 0.15); color: #794bc4; }
.stat-card-icon.yellow { background: rgba(255, 193, 7, 0.15); color: #ffc107; }

.stat-card-content {
    flex: 1;
    min-width: 0;
}

.stat-card-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.stat-card-label {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Charts Row */
.stats-charts-row {
    display: grid;
    grid-template-columns: 1fr 1fr 2fr;
    gap: 16px;
    margin-bottom: 24px;
}

.stats-chart-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.stats-chart-card.wide {
    grid-column: span 1;
}

.chart-card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}

.chart-card-header h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.chart-card-body {
    padding: 20px;
}

/* Donut Chart */
.donut-chart-container {
    display: flex;
    align-items: center;
    gap: 24px;
}

.donut-chart {
    position: relative;
    width: 120px;
    height: 120px;
    flex-shrink: 0;
}

.donut-svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.donut-segment {
    transition: opacity 0.3s;
}

.donut-segment:hover {
    opacity: 0.8;
}

.donut-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.donut-total {
    display: block;
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
}

.donut-label {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

.donut-legend {
    flex: 1;
    min-width: 0;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    border-bottom: 1px solid var(--border-light);
}

.legend-item:last-child {
    border-bottom: none;
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    flex-shrink: 0;
}

.legend-label {
    flex: 1;
    font-size: 13px;
    color: var(--text-primary);
}

.legend-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    min-width: 30px;
    text-align: right;
}

.legend-percent {
    font-size: 12px;
    color: var(--text-muted);
    min-width: 45px;
    text-align: right;
}

.empty-legend {
    color: var(--text-muted);
    font-size: 13px;
    text-align: center;
    padding: 20px;
}

/* Bar Chart */
.bar-chart-container {
    height: 200px;
}

.bar-chart {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    height: 100%;
    gap: 8px;
    padding-top: 20px;
}

.bar-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
}

.bar-value {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.bar-fill {
    width: 100%;
    max-width: 40px;
    background: linear-gradient(180deg, var(--accent-primary), rgba(29, 161, 242, 0.6));
    border-radius: 4px 4px 0 0;
    min-height: 4px;
    transition: height 0.5s ease;
}

.bar-label {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 8px;
    text-align: center;
}

.empty-chart {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-muted);
    font-size: 14px;
}

/* Lists Row */
.stats-lists-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.stats-list-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.list-card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}

.list-card-header h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.list-card-body {
    padding: 12px 0;
    max-height: 300px;
    overflow-y: auto;
}

.empty-list {
    padding: 30px 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
}

/* User Downloads List */
.user-download-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    transition: background 0.2s;
}

.user-download-item:hover {
    background: var(--bg-hover);
}

.user-rank {
    width: 24px;
    height: 24px;
    background: var(--bg-tertiary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.user-download-item:first-child .user-rank {
    background: linear-gradient(135deg, #ffd700, #ffb700);
    color: #000;
}

.user-download-item:nth-child(2) .user-rank {
    background: linear-gradient(135deg, #c0c0c0, #a0a0a0);
    color: #000;
}

.user-download-item:nth-child(3) .user-rank {
    background: linear-gradient(135deg, #cd7f32, #b5651d);
    color: #fff;
}

.user-info {
    flex: 1;
    min-width: 0;
}

.user-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.user-bar {
    height: 4px;
    background: var(--bg-tertiary);
    border-radius: 2px;
    overflow: hidden;
}

.user-bar-fill {
    height: 100%;
    background: var(--accent-primary);
    border-radius: 2px;
    transition: width 0.5s ease;
}

.user-count {
    font-size: 14px;
    font-weight: 600;
    color: var(--accent-primary);
    min-width: 40px;
    text-align: right;
}

/* File Types Breakdown */
.file-type-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    transition: background 0.2s;
}

.file-type-item:hover {
    background: var(--bg-hover);
}

.file-type-icon {
    width: 40px;
    height: 40px;
    background: var(--bg-tertiary);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--text-secondary);
}

.file-type-info {
    flex: 1;
    min-width: 0;
}

.file-type-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.file-type-bar {
    height: 4px;
    background: var(--bg-tertiary);
    border-radius: 2px;
    overflow: hidden;
}

.file-type-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    border-radius: 2px;
    transition: width 0.5s ease;
}

.file-type-stats {
    text-align: right;
    flex-shrink: 0;
}

.file-type-count {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.file-type-size {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Activity List */
.activity-item {
    display: flex;
    gap: 12px;
    padding: 12px 20px;
    transition: background 0.2s;
}

.activity-item:hover {
    background: var(--bg-hover);
}

.activity-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

.activity-icon.upload { background: rgba(23, 191, 99, 0.15); color: #17bf63; }
.activity-icon.download { background: rgba(29, 161, 242, 0.15); color: #1da1f2; }
.activity-icon.delete { background: rgba(224, 36, 94, 0.15); color: #e0245e; }
.activity-icon.update { background: rgba(255, 173, 31, 0.15); color: #ffad1f; }
.activity-icon.view { background: rgba(121, 75, 196, 0.15); color: #794bc4; }

.activity-content {
    flex: 1;
    min-width: 0;
}

.activity-text {
    font-size: 13px;
    color: var(--text-primary);
    line-height: 1.4;
}

.activity-text strong {
    font-weight: 600;
}

.activity-entity {
    color: var(--accent-primary);
}

.activity-time {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Stats Page Mobile */
@media (max-width: 1200px) {
    .stats-summary-row {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .stats-charts-row {
        grid-template-columns: 1fr 1fr;
    }
    
    .stats-chart-card.wide {
        grid-column: span 2;
    }
    
    .stats-lists-row {
        grid-template-columns: 1fr 1fr;
    }
    
    .stats-lists-row .stats-list-card:last-child {
        grid-column: span 2;
    }
}

@media (max-width: 768px) {
    .stats-summary-row {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .stat-card-large {
        padding: 16px;
    }
    
    .stat-card-icon {
        width: 44px;
        height: 44px;
    }
    
    .stat-card-value {
        font-size: 22px;
    }
    
    .stats-charts-row {
        grid-template-columns: 1fr;
    }
    
    .stats-chart-card.wide {
        grid-column: span 1;
    }
    
    .donut-chart-container {
        flex-direction: column;
        text-align: center;
    }
    
    .stats-lists-row {
        grid-template-columns: 1fr;
    }
    
    .stats-lists-row .stats-list-card:last-child {
        grid-column: span 1;
    }
}

/* ========================================
   Mobile Menu - Hamburger & Overlay
   ======================================== */

/* Mobile menu button - hidden on desktop */
.mobile-menu-btn {
    display: none;
    background: transparent;
    border: none;
    color: var(--text-primary);
    padding: 8px;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
}

.mobile-menu-btn:hover {
    background: var(--bg-hover);
}

.mobile-menu-btn.open svg {
    transform: rotate(90deg);
}

.mobile-menu-btn svg {
    transition: transform 0.3s ease;
}

/* Mobile menu overlay */
.mobile-menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 499;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.mobile-menu-overlay.open {
    opacity: 1;
    visibility: visible;
}

/* Prevent body scroll when mobile menu is open */
body.mobile-menu-open {
    overflow: hidden;
}

/* Mobile styles */
@media (max-width: 768px) {
    /* Show hamburger button */
    .mobile-menu-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        margin-right: 8px;
    }

    /* Show overlay layer */
    .mobile-menu-overlay {
        display: block;
    }

    /* Sidebar mobile styles */
    .sidebar {
        position: fixed;
        left: -280px;
        top: 0;
        bottom: 0;
        width: 280px;
        z-index: 500;
        transition: left 0.3s ease;
        box-shadow: none;
        padding-top: var(--header-height);
    }

    .sidebar.open {
        left: 0;
        box-shadow: 4px 0 20px rgba(0, 0, 0, 0.3);
    }

    /* Header adjustments for mobile */
    .header {
        padding: 0 12px;
    }

    .header-left {
        gap: 8px;
    }

    .logo span {
        display: none;
    }

    .logo svg {
        width: 32px;
        height: 32px;
    }

    .tenant-selector {
        max-width: 140px;
    }

    .tenant-btn span {
        max-width: 100px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    /* Header center (search) - hide on mobile */
    .header-center {
        display: none;
    }

    /* Header right adjustments */
    .header-right {
        gap: 8px;
    }

    .upload-header-btn span {
        display: none;
    }

    .upload-header-btn {
        padding: 8px 12px;
    }

    /* User menu simplified */
    .user-menu .user-btn {
        padding: 4px;
    }

    #notifications-btn {
        display: none;
    }

    /* Main content area */
    .main-container {
        margin-left: 0;
    }

    .content-area {
        padding: 16px;
    }

    /* Page headers */
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .page-header h1 {
        font-size: 20px;
    }

    .toolbar {
        flex-wrap: wrap;
        gap: 8px;
    }

    .toolbar-group {
        gap: 6px;
    }

    /* Detail panel mobile - full width */
    .detail-panel {
        width: 100%;
        max-width: 100%;
    }

    .detail-panel.open {
        right: 0;
    }
}

/* Very small screens */
@media (max-width: 480px) {
    .header {
        padding: 0 8px;
    }

    .tenant-selector {
        display: none;
    }

    .sidebar {
        width: 260px;
        left: -260px;
    }

    .content-area {
        padding: 12px;
    }

    /* Stats summary cards - single column on very small */
    .stats-summary-row {
        grid-template-columns: 1fr;
    }

    .stat-card-large {
        padding: 14px;
    }

    .stat-card-value {
        font-size: 20px;
    }
}

/* ========================================
   Search Dropdown
   ======================================== */
.search-box {
    position: relative;
}

.search-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 8px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    max-height: 400px;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
}

.search-dropdown.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.search-dropdown-content {
    padding: 8px;
}

.search-section {
    margin-bottom: 8px;
}

.search-section:last-child {
    margin-bottom: 0;
}

.search-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background 0.15s ease;
}

.search-result-item:hover,
.search-result-item:focus {
    background: var(--bg-hover);
    outline: none;
}

.search-result-item svg {
    flex-shrink: 0;
}

.search-result-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.search-result-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-result-path,
.search-result-meta {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-no-results {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 32px 16px;
    color: var(--text-muted);
}

.search-no-results svg {
    opacity: 0.5;
}

.search-no-results span {
    font-size: 14px;
}

/* Search dropdown mobile */
@media (max-width: 768px) {
    .search-dropdown {
        position: fixed;
        left: 16px;
        right: 16px;
        top: calc(var(--header-height) + 8px);
        max-height: calc(100vh - var(--header-height) - 100px);
    }
}

/* ========================================
   User Invite Modal - Multi Step
   ======================================== */
.user-found-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-lg);
    margin-bottom: 16px;
}

.user-found-icon {
    flex-shrink: 0;
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(23, 191, 99, 0.1);
    border-radius: 50%;
}

.user-found-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.user-found-label {
    font-size: 12px;
    color: var(--accent-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.user-found-name {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.user-found-email {
    font-size: 14px;
    color: var(--text-secondary);
}

/* Alerts in modal */
.alert {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border-radius: var(--radius-md);
    margin-bottom: 16px;
    font-size: 14px;
    line-height: 1.5;
}

.alert svg {
    flex-shrink: 0;
    margin-top: 2px;
}

.alert-info {
    background: rgba(29, 161, 242, 0.1);
    border: 1px solid rgba(29, 161, 242, 0.3);
    color: var(--accent-primary);
}

.alert-warning {
    background: rgba(255, 173, 31, 0.1);
    border: 1px solid rgba(255, 173, 31, 0.3);
    color: var(--accent-warning);
}

.alert-danger {
    background: rgba(224, 36, 94, 0.1);
    border: 1px solid rgba(224, 36, 94, 0.3);
    color: var(--accent-danger);
}

.alert-success {
    background: rgba(23, 191, 99, 0.1);
    border: 1px solid rgba(23, 191, 99, 0.3);
    color: var(--accent-secondary);
}

/* Form hint with warning */
.form-hint-warning {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--accent-warning);
    margin-top: 8px;
}

.form-hint-warning svg {
    flex-shrink: 0;
}

/* =====================================================
   EMBED CUSTOMIZATION VIEW - FULL SCREEN
   ===================================================== */

#customization-view {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    background: #f8fafc;
}

.customization-fullscreen {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100vw;
}

/* Customization Header */
.customization-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 24px;
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    flex-shrink: 0;
}

.customization-header-left {
    display: flex;
    align-items: center;
}

.customization-header-center {
    flex: 1;
    text-align: center;
}

.customization-header-center h1 {
    font-size: 18px;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
}

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

.btn-ghost {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: transparent;
    border: none;
    color: #64748b;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s;
}

.btn-ghost:hover {
    background: #f1f5f9;
    color: #1e293b;
}

/* Customization Body */
.customization-body {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* Customization Sidebar */
.customization-sidebar {
    width: 320px;
    flex-shrink: 0;
    background: #ffffff;
    border-right: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.customizer-tabs {
    display: flex;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
    flex-shrink: 0;
    overflow-x: auto;
}

.customizer-tab {
    flex: 1;
    min-width: fit-content;
    padding: 14px 6px;
    font-size: 11px;
    font-weight: 500;
    text-align: center;
    background: transparent;
    border: none;
    cursor: pointer;
    color: #64748b;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
    white-space: nowrap;
}

.customizer-tab:hover {
    color: #1e293b;
    background: #f1f5f9;
}

.customizer-tab.active {
    color: #6366f1;
    background: #ffffff;
    border-bottom-color: #6366f1;
}

.customizer-panel {
    display: none;
    padding: 20px;
    flex: 1;
    overflow-y: auto;
}

.customizer-panel.active {
    display: block;
}

.customizer-panel .form-section {
    margin-bottom: 20px;
}

.customizer-panel .form-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 500;
    color: #475569;
    margin-bottom: 8px;
}

.customizer-panel .form-select,
.customizer-panel .form-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    background: #ffffff;
    color: #1e293b;
    transition: border-color 0.2s;
}

.customizer-panel .form-select:focus,
.customizer-panel .form-input:focus {
    outline: none;
    border-color: #6366f1;
}

.customizer-panel .form-range {
    width: 100%;
    margin-top: 4px;
    accent-color: #6366f1;
}

.customizer-panel .form-color {
    width: 100%;
    height: 44px;
    padding: 4px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    background: #ffffff;
}

.customizer-panel hr {
    margin: 20px 0;
    border: none;
    border-top: 1px solid #e2e8f0;
}

.customizer-panel .form-hint {
    font-size: 12px;
    color: #94a3b8;
    margin-top: 4px;
}

/* Panel Section Titles */
.panel-section-title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #94a3b8;
    margin: 24px 0 12px 0;
    padding-bottom: 8px;
    border-bottom: 1px solid #f1f5f9;
}

.panel-section-title:first-child {
    margin-top: 0;
}

/* Color Input Wrapper */
.color-input-wrapper {
    display: flex;
    gap: 8px;
    align-items: center;
}

.color-input-wrapper .form-color {
    width: 48px;
    height: 40px;
    flex-shrink: 0;
}

.form-color-text {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 13px;
    font-family: monospace;
    text-transform: uppercase;
}

.form-color-text:focus {
    outline: none;
    border-color: #6366f1;
}

/* Checkbox Label Style */
.checkbox-label {
    display: flex !important;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #6366f1;
    cursor: pointer;
}

.checkbox-label span {
    font-weight: 400;
    color: #1e293b;
}

/* Tile Size Selector */
.tile-size-selector {
    display: flex;
    gap: 8px;
}

.tile-size-btn {
    flex: 1;
    padding: 10px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #ffffff;
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s;
}

.tile-size-btn:hover {
    border-color: #cbd5e1;
    background: #f8fafc;
}

.tile-size-btn.active {
    border-color: #6366f1;
    background: #6366f1;
    color: white;
}

/* View Mode Selector */
.view-mode-selector {
    display: flex;
    gap: 8px;
}

.view-mode-btn {
    flex: 1;
    padding: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #ffffff;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.view-mode-btn:hover {
    border-color: #cbd5e1;
    background: #f8fafc;
}

.view-mode-btn.active {
    border-color: #6366f1;
    background: #6366f1;
    color: white;
}

/* Align Selector */
.align-selector {
    display: flex;
    gap: 6px;
}

.align-btn {
    padding: 8px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: #ffffff;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.align-btn:hover {
    border-color: #cbd5e1;
    background: #f8fafc;
}

.align-btn.active {
    border-color: #6366f1;
    background: #eef2ff;
    color: #6366f1;
}

/* Embed Status Section */
.embed-status-section {
    background: #f0fdf4;
    margin: 0 -20px -20px -20px;
    padding: 16px 20px;
    border-top: 1px solid #bbf7d0;
}

.embed-status-section .form-hint {
    color: #16a34a;
}

/* Icon Upload Grid */
.icon-upload-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.icon-upload-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 12px 6px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    text-align: center;
}

.icon-upload-item:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.icon-preview {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.icon-preview img {
    max-width: 32px;
    max-height: 32px;
    object-fit: contain;
}

.icon-label {
    font-size: 12px;
    font-weight: 500;
    color: #64748b;
}

.icon-actions {
    display: flex;
    gap: 4px;
    align-items: center;
}

.icon-actions .btn-sm {
    padding: 4px 8px;
    font-size: 11px;
}

.icon-actions .btn-ghost {
    padding: 4px 6px;
    color: #94a3b8;
}

.icon-actions .btn-ghost:hover {
    color: #ef4444;
    background: #fef2f2;
}

/* Folder Icons Accordion */
.folder-icons-accordion {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
}

.folder-icons-accordion .accordion-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: #f8fafc;
    cursor: pointer;
    transition: background 0.15s;
}

.folder-icons-accordion .accordion-header:hover {
    background: #f1f5f9;
}

.folder-icons-accordion .accordion-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
    color: #1e293b;
}

.folder-icons-accordion .folder-icons-count {
    font-size: 12px;
    color: #64748b;
    background: #e2e8f0;
    padding: 2px 8px;
    border-radius: 10px;
}

.folder-icons-accordion .accordion-arrow {
    color: #64748b;
    transition: transform 0.2s;
}

.folder-icons-accordion.open .accordion-arrow {
    transform: rotate(180deg);
}

.folder-icons-accordion .accordion-content {
    padding: 16px;
    border-top: 1px solid #e2e8f0;
    background: #ffffff;
    max-height: 400px;
    overflow-y: auto;
}

/* Folder Icons Tree */
.folder-icons-tree {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.folder-icons-tree .loading-placeholder {
    color: #64748b;
    font-size: 13px;
    padding: 20px;
    text-align: center;
}

.folder-icon-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 6px;
    transition: background 0.15s;
}

.folder-icon-item:hover {
    background: #f8fafc;
}

.folder-icon-item .folder-indent {
    display: flex;
    align-items: center;
}

.folder-icon-item .folder-icon-preview {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    flex-shrink: 0;
    overflow: hidden;
}

.folder-icon-item .folder-icon-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.folder-icon-item .folder-icon-preview.has-icon {
    border-color: #6366f1;
    background: #eef2ff;
}

.folder-icon-item .folder-name {
    flex: 1;
    font-size: 13px;
    color: #334155;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.folder-icon-item .folder-icon-actions {
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.15s;
}

.folder-icon-item:hover .folder-icon-actions {
    opacity: 1;
}

.folder-icon-item .folder-icon-actions .btn-sm {
    padding: 4px 8px;
    font-size: 11px;
}

.folder-icon-item .folder-icon-actions .btn-remove {
    color: #94a3b8;
    padding: 4px 6px;
    background: none;
    border: none;
    cursor: pointer;
    border-radius: 4px;
}

.folder-icon-item .folder-icon-actions .btn-remove:hover {
    color: #ef4444;
    background: #fef2f2;
}

/* Customization Preview */
.customization-preview {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #f1f5f9;
    overflow: hidden;
}

.preview-toolbar {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    gap: 8px;
    flex-shrink: 0;
}

.preview-device {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    color: #64748b;
    transition: all 0.2s;
}

.preview-device:hover {
    color: #1e293b;
    border-color: #cbd5e1;
    background: #f8fafc;
}

.preview-device.active {
    background: #6366f1;
    border-color: #6366f1;
    color: white;
}

.preview-spacer {
    flex: 1;
}

.preview-frame {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px;
    overflow: auto;
    background: #e2e8f0;
}

.preview-content {
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.12);
    overflow: hidden;
    transition: all 0.3s ease;
    position: relative;
}

.preview-frame.desktop .preview-content {
    width: 100%;
    max-width: 960px;
    height: 100%;
    min-height: 450px;
}

.preview-frame.tablet .preview-content {
    width: 768px;
    height: 100%;
    min-height: 450px;
}

.preview-frame.mobile .preview-content {
    width: 375px;
    height: 100%;
    min-height: 450px;
}

/* Preview Content Styles */
.embed-preview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid #e5e7eb;
}

.embed-preview-header h3 {
    font-size: 16px;
    font-weight: 600;
}

.embed-preview-search {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 13px;
    color: #6b7280;
}

.embed-preview-main {
    display: flex;
    min-height: 300px;
}

.embed-preview-sidebar {
    width: 180px;
    padding: 16px;
    border-right: 1px solid #e5e7eb;
}

.embed-preview-sidebar a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    margin-bottom: 4px;
    border-radius: 6px;
    font-size: 13px;
    color: #6b7280;
    text-decoration: none;
}

.embed-preview-sidebar a:hover,
.embed-preview-sidebar a.active {
    background: rgba(99, 102, 241, 0.1);
    color: #6366f1;
}

.embed-preview-content {
    flex: 1;
    padding: 16px;
}

.embed-preview-grid {
    display: grid;
    gap: 12px;
}

.embed-preview-tile {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
}

.embed-preview-tile-img {
    height: 80px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.embed-preview-tile-info {
    padding: 10px;
}

.embed-preview-tile-name {
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.embed-preview-tile-meta {
    font-size: 11px;
    color: #6b7280;
}

/* Embed Code Modal */
.embed-code-modal .modal-body {
    padding: 20px;
}

.embed-code-section {
    margin-bottom: 20px;
}

.embed-code-section label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.embed-code-box {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 12px;
    font-family: monospace;
    font-size: 12px;
    word-break: break-all;
    position: relative;
}

.embed-code-box .copy-btn {
    position: absolute;
    top: 8px;
    right: 8px;
}

/* ========================================
   Language Selector
   ======================================== */
.language-selector {
    position: relative;
    display: inline-block;
}

.language-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    cursor: pointer;
    font-size: 14px;
    transition: all 0.15s ease;
}

.language-btn:hover {
    background: var(--bg-hover);
    border-color: var(--border-light);
}

.language-btn .lang-flag {
    font-size: 18px;
    line-height: 1;
}

.language-btn .lang-name {
    font-weight: 500;
}

.language-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 180px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    padding: 8px;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
}

.language-selector:hover .language-dropdown,
.language-selector:focus-within .language-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(4px);
}

.language-option {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 12px;
    background: none;
    border: none;
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: left;
}

.language-option:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.language-option.active {
    background: rgba(29, 161, 242, 0.1);
    color: var(--accent-primary);
}

.language-option .lang-flag {
    font-size: 18px;
    line-height: 1;
}

.language-option .lang-name {
    flex: 1;
}

.language-option svg {
    color: var(--accent-primary);
}

/* Language selector in header */
.header-right .language-selector {
    margin-right: 8px;
}

.header-right .language-btn {
    padding: 6px 10px;
    background: transparent;
    border-color: transparent;
}

.header-right .language-btn:hover {
    background: var(--bg-hover);
}

/* Compact language selector for embed */
.language-selector.compact .language-btn {
    padding: 6px 8px;
    font-size: 12px;
}

.language-selector.compact .lang-flag {
    font-size: 16px;
}

.language-selector.compact .lang-name {
    display: none;
}

@media (max-width: 768px) {
    .language-btn .lang-name {
        display: none;
    }

    .language-dropdown {
        right: auto;
        left: 0;
    }
}

/* ========================================
   Languages List (Admin Settings)
   ======================================== */
.languages-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.language-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    transition: all 0.15s ease;
}

.language-item:hover {
    background: var(--bg-hover);
}

.language-item.enabled {
    border-color: var(--accent-primary);
    background: rgba(29, 161, 242, 0.05);
}

.language-item .lang-flag {
    font-size: 24px;
    line-height: 1;
}

.language-item .lang-info {
    flex: 1;
}

.language-item .lang-name {
    font-weight: 500;
    color: var(--text-primary);
}

.language-item .lang-native {
    font-size: 12px;
    color: var(--text-secondary);
}

.language-item .lang-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.language-item .default-badge {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--accent-primary);
    background: rgba(29, 161, 242, 0.15);
    padding: 4px 8px;
    border-radius: 4px;
}

.language-item .btn-set-default {
    font-size: 12px;
    color: var(--text-secondary);
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.15s ease;
}

.language-item .btn-set-default:hover {
    color: var(--accent-primary);
    background: rgba(29, 161, 242, 0.1);
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-switch .slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--bg-tertiary);
    transition: 0.3s;
    border-radius: 24px;
}

.toggle-switch .slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

.toggle-switch input:checked + .slider {
    background-color: var(--accent-primary);
}

.toggle-switch input:checked + .slider:before {
    transform: translateX(20px);
}

.toggle-switch input:disabled + .slider {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Toggle slider variant for language items */
.toggle-switch .toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--bg-tertiary);
    transition: 0.3s;
    border-radius: 24px;
}

.toggle-switch .toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

.toggle-switch input:checked + .toggle-slider {
    background-color: var(--accent-primary);
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(20px);
}

.toggle-switch input:disabled + .toggle-slider {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Language item alternate classes */
.language-info {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
}

.language-name {
    font-weight: 500;
    color: var(--text-primary);
}

.language-code {
    font-size: 12px;
    color: var(--text-secondary);
    background: var(--bg-tertiary);
    padding: 2px 6px;
    border-radius: 4px;
}

.language-default-badge {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--accent-primary);
    background: rgba(29, 161, 242, 0.15);
    padding: 4px 8px;
    border-radius: 4px;
}

.language-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ========================================
   Translations Editor
   ======================================== */
.translations-toolbar {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.translations-toolbar select {
    min-width: 200px;
    padding: 8px 12px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 14px;
}

.translations-toolbar input {
    flex: 1;
    padding: 8px 12px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 14px;
}

.translations-content {
    flex: 1;
    overflow-y: auto;
    padding-right: 8px;
}

.translations-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.translations-section {
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    padding: 16px;
}

.translations-section-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--accent-primary);
    margin: 0 0 12px 0;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

.translation-row {
    display: grid;
    grid-template-columns: 180px 1fr 1fr;
    gap: 12px;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
}

.translation-row:last-child {
    border-bottom: none;
}

.translation-key {
    font-family: monospace;
    font-size: 12px;
    color: var(--text-secondary);
    word-break: break-all;
}

.translation-original {
    font-size: 13px;
    color: var(--text-muted);
    padding: 6px 10px;
    background: var(--bg-tertiary);
    border-radius: 4px;
}

.translation-input {
    width: 100%;
    padding: 8px 10px;
    font-size: 13px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-primary);
    transition: border-color 0.15s ease;
}

.translation-input:focus {
    border-color: var(--accent-primary);
    outline: none;
}

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

/* Button extra small */
.btn-xs {
    padding: 4px 8px;
    font-size: 12px;
}

/* ========================================
   Asset Translations Accordion
   ======================================== */
.translations-accordion {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.translations-accordion-header {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.15s ease;
}

.translations-accordion-header:hover {
    background: var(--bg-hover);
}

.translations-accordion-header .accordion-chevron {
    margin-left: auto;
    transition: transform 0.2s ease;
}

.translations-accordion.open .accordion-chevron {
    transform: rotate(180deg);
}

.translations-accordion-content {
    display: none;
    padding: 16px;
    background: var(--bg-tertiary);
    border-top: 1px solid var(--border-color);
}

.translations-accordion.open .translations-accordion-content {
    display: block;
}

.translation-lang-group {
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.translation-lang-group:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.translation-lang-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    font-weight: 500;
    color: var(--text-primary);
}

.translation-lang-header .lang-code {
    font-size: 11px;
    color: var(--text-secondary);
    background: var(--bg-secondary);
    padding: 2px 6px;
    border-radius: 4px;
}

.translation-lang-group .form-group {
    margin-bottom: 8px;
}

.translation-lang-group .form-group:last-child {
    margin-bottom: 0;
}

.translation-lang-group label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.translation-lang-group input,
.translation-lang-group textarea {
    font-size: 13px;
}

/* Language checkboxes grid */
.language-checkboxes {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.language-checkbox {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.language-checkbox:hover {
    background: var(--bg-hover);
}

.language-checkbox.selected {
    background: rgba(29, 161, 242, 0.1);
    border-color: var(--accent-primary);
}

.language-checkbox input {
    display: none;
}

.language-checkbox .checkmark {
    width: 16px;
    height: 16px;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.language-checkbox.selected .checkmark {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
}

.language-checkbox .checkmark svg {
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.15s ease;
}

.language-checkbox.selected .checkmark svg {
    opacity: 1;
    transform: scale(1);
}

.language-checkbox .lang-name {
    font-size: 13px;
    color: var(--text-primary);
}


/* Tags Management in Settings */
.tags-management-list {
    max-height: 400px;
    overflow-y: auto;
}

.tag-management-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    margin-bottom: 8px;
    background: var(--bg-card);
}

.tag-management-item:hover {
    background: var(--bg-hover);
}

.tag-management-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.tag-management-color {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    flex-shrink: 0;
}

.tag-management-name {
    font-weight: 500;
}

.tag-management-count {
    color: var(--text-muted);
    font-size: 13px;
    background: var(--bg-tertiary);
    padding: 2px 8px;
    border-radius: 12px;
    margin-left: 8px;
}

.tag-management-count.unused {
    background: var(--warning-bg, #fef3c7);
    color: var(--warning-text, #92400e);
}

.tag-management-actions {
    display: flex;
    gap: 8px;
}

.tags-empty-message {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}

/* Registration Forms Management */
.registration-forms-list {
    max-height: 400px;
    overflow-y: auto;
}

.registration-form-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    margin-bottom: 12px;
    background: var(--bg-card);
}

.registration-form-item:hover {
    background: var(--bg-hover);
}

.registration-form-info {
    flex: 1;
}

.registration-form-name {
    font-weight: 600;
    font-size: 15px;
    margin-bottom: 4px;
}

.registration-form-details {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: var(--text-muted);
}

.registration-form-details span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.registration-form-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
}

.registration-form-badge.active {
    background: var(--success-bg, #d1fae5);
    color: var(--success-text, #065f46);
}

.registration-form-badge.inactive {
    background: var(--bg-tertiary);
    color: var(--text-muted);
}

.registration-form-actions {
    display: flex;
    gap: 8px;
}

/* Code display sections */
.code-section {
    margin-bottom: 24px;
}

.code-section h4 {
    margin-bottom: 8px;
}

.code-block {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px;
    position: relative;
}

.code-block pre {
    margin: 0;
    white-space: pre-wrap;
    word-break: break-all;
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 12px;
    line-height: 1.5;
    max-height: 150px;
    overflow-y: auto;
}

.code-block button {
    position: absolute;
    top: 8px;
    right: 8px;
}

.forms-empty-message {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}
