/* Dark Glassmorphism Design System */
:root {
    /* Core Colors */
    --bg-dark: #0f0c29;
    --bg-dark-accent: #302b63;
    --bg-light-accent: #24243e;
    
    /* Neon Accents */
    --neon-cyan: #00f2ff;
    --neon-purple: #bc13fe;
    --neon-blue: #4d4dff;
    
    /* Text Colors */
    --text-main: #ffffff;
    --text-muted: #a0a0c0;
    --text-dim: #6c6c8c;
    
    /* Glass Variables */
    --glass-bg: rgba(20, 20, 40, 0.6);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-highlight: rgba(255, 255, 255, 0.05);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5);
    
    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text-main);
    background: url('../img/bg-main.webp') no-repeat center center fixed;
    background-size: cover;
    min-height: 100vh;
    overflow-x: hidden;
}

/* ============================================================
   SCROLLING + DROPDOWN SAFE LAYOUT
   Goal:
   - Keep vertical scrolling
   - Prevent dropdowns / popovers from being clipped
   - Avoid body-based clipping issues
   ============================================================ */

html, body {
    height: 100%;
}

body {
    overflow-x: hidden;
    overflow-y: visible;
}

/* 2) Do NOT put overflow clipping on app-level containers */
.main-content,
.main-container,
.library-page,
.page-container {
    overflow: visible !important;
}

/* 3) Anchor the Tags+ dropdown correctly */
#tagFilterContainer {
    position: relative;
    overflow: visible;
}

/* 4) Dropdown must float above cards */
#tagFilterDropdown,
#tagFilterContainer .multi-select-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 99999;
    max-height: 320px;
    overflow-y: auto;
    width: max-content;
    min-width: 220px;
    max-width: 60vw;
}

#tagFilterDropdown .dropdown-item {
    white-space: nowrap;
}

/* 5) Safety: glass / blur panels create stacking contexts */
.app-header,
.filters-bar,
.filter-toolbar,
.search-toolbar {
    overflow: visible !important;
    position: relative;
    z-index: 50;
}

/* Overlay to ensure text readability if bg is too bright */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 12, 41, 0.7);
    z-index: -1;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Glass Components */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: var(--glass-shadow);
    border-radius: var(--radius-lg);
}

/* Navbar */
.navbar {
    background: rgba(15, 12, 41, 0.8);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    padding: 1.2rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
}

/* App Header */
.app-header {
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    background: linear-gradient(90deg, #0f172a, #1e1b4b);
}

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

.logo-link {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.app-logo {
    height: 44px;
    width: auto;
    display: block;
    opacity: 0.9;
}

.app-title {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-weight: 500;
    font-size: 20px;
    color: #ffffff;
    white-space: nowrap;
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 28px;
}

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

.nav-link {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 16px;
    color: rgba(255, 255, 255, 0.75);
    text-decoration: none;
}

.nav-link:hover {
    color: #ffffff;
}

.avatar-button {
    display: flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    cursor: pointer;
    color: #ffffff;
}

.avatar-button:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 242, 255, 0.2);
    border-radius: 8px;
}

.avatar-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.25);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    color: #ffffff;
}

.avatar-button.dropdown-toggle::after {
    margin-left: 8px;
}

.duplicate-actions {
    margin-top: 12px;
    padding: 12px;
    border: 1px solid rgba(255, 77, 77, 0.35);
    border-radius: 12px;
    background: rgba(255, 77, 77, 0.08);
}

.duplicate-message {
    color: #ffd0d0;
    font-size: 14px;
    margin-bottom: 10px;
}

.duplicate-buttons {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* Google sign-in button */
.google-login-btn {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    background: #ffffff;
    color: #3c4043;
    border: 1px solid #dadce0;
    border-radius: 999px;
    text-decoration: none;
    font-weight: 500;
    box-shadow: 0 1px 2px rgba(60, 64, 67, 0.15);
    transition: box-shadow 120ms ease, border-color 120ms ease, transform 120ms ease;
}

.google-login-btn:hover {
    border-color: #c4c7c5;
    box-shadow: 0 2px 4px rgba(60, 64, 67, 0.2);
    transform: translateY(-1px);
    color: #3c4043;
}

.google-login-btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(60, 64, 67, 0.15);
}

.google-login-icon {
    display: inline-flex;
    width: 20px;
    height: 20px;
}

.google-login-icon svg {
    width: 20px;
    height: 20px;
    display: block;
}

.google-login-text {
    font-size: 15px;
    line-height: 1;
}

/* Search + Upload Row */
.search-row {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 24px;
}

.search-wrap {
    flex: 1;
    height: 48px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 16px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.10);
}

.search-icon {
    opacity: 0.7;
}

.search-icon {
    opacity: 0.7;
}

.search-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: rgba(255, 255, 255, 0.85);
    font-size: 16px;
}

.search-input::placeholder {
    color: rgba(255, 255, 255, 0.45);
}

.icon-button {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.65);
    cursor: pointer;
    padding: 8px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-button:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.06);
}

.icon-button.is-open {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: #ffffff;
}

.upload-button {
    height: 48px;
    padding: 0 18px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.10);
    color: #ffffff;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

.upload-button:hover {
    background: rgba(255, 255, 255, 0.16);
}

.upload-button.is-active {
    background: rgba(255, 255, 255, 0.18);
}

.upload-panel {
    margin: 0 24px 24px;
}

.upload-panel[hidden] {
    display: none;
}

.upload-panel-inner {
    padding: 1rem 0 0;
}

body.upload-modal-open .search-row {
    display: none;
}

.navbar .container {
    display: flex;
    align-items: center;
    gap: 2rem;
    flex-wrap: nowrap;
    width: 100%;
}

.nav-brand h1 {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(90deg, var(--neon-cyan), var(--neon-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 20px rgba(188, 19, 254, 0.3);
    letter-spacing: 0.5px;
    white-space: nowrap;
    margin: 0;
    line-height: 1;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
    align-items: center;
    margin: 0;
    padding: 0;
    width: 100%;
    flex-wrap: nowrap;
    white-space: nowrap;
}

.nav-menu li {
    display: flex;
    align-items: center;
}

.nav-user {
    margin-left: auto;
}

.nav-user .dropdown-toggle {
    height: 38px;
    padding: 0 10px;
    color: var(--text-muted);
    border-radius: 50%;
    line-height: 1;
    display: flex;
    align-items: center;
}

.nav-user .dropdown-toggle::after {
    margin-left: 6px;
    vertical-align: middle;
}

.nav-user-icon {
    font-size: 1.2rem;
    line-height: 1;
    display: flex;
    align-items: center;
}

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

.nav-menu a {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s;
    padding: 0 12px;
    height: 38px;
    border-radius: var(--radius-sm);
    position: relative;
    line-height: 1;
    display: flex;
    align-items: center;
}

.nav-menu a:hover, .nav-menu a.active {
    color: var(--text-main);
    text-shadow: 0 0 10px var(--neon-cyan);
}

.nav-menu a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--neon-cyan);
    transition: all 0.3s;
    transform: translateX(-50%);
    box-shadow: 0 0 10px var(--neon-cyan);
}

.nav-menu a:hover::after {
    width: 80%;
}

/* Main Content */
.main-content {
    padding: 3rem 0;
    min-height: calc(100vh - 140px);
}

.library-page {
    overflow: visible;
}

/* Footer */
.footer {
    background: rgba(15, 12, 41, 0.8);
    backdrop-filter: blur(10px);
    color: var(--text-muted);
    text-align: center;
    padding: 2rem 0;
    margin-top: auto;
    border-top: 1px solid var(--glass-border);
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 5rem 0;
}

.hero h2 {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
    color: var(--text-main);
    font-weight: 800;
    letter-spacing: -1px;
    text-shadow: 0 0 30px rgba(0, 242, 255, 0.2);
}

.hero p {
    font-size: 1.25rem;
    color: var(--text-muted);
    margin-bottom: 4rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* Action Cards */
.action-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2.5rem;
    margin-top: 2rem;
}

.card {
    background: linear-gradient(145deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0.01) 100%);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-top: 1px solid rgba(255,255,255,0.15);
    border-radius: var(--radius-lg);
    padding: 3rem 2rem;
    text-align: center;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at top right, rgba(188, 19, 254, 0.1), transparent 60%);
    opacity: 0;
    transition: opacity 0.4s;
}

.card:hover {
    transform: translateY(-10px);
    border-color: rgba(255,255,255,0.3);
    box-shadow: 0 20px 40px rgba(0,0,0,0.4), 0 0 20px rgba(188, 19, 254, 0.2);
}

.card:hover::before {
    opacity: 1;
}

.card h3 {
    font-size: 1.75rem;
    margin-bottom: 1rem;
    color: var(--text-main);
    position: relative;
    z-index: 1;
}

.card p {
    color: var(--text-muted);
    margin-bottom: 2.5rem;
    position: relative;
    z-index: 1;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.85rem 2rem;
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    z-index: 1;
}

.btn-primary {
    background: linear-gradient(90deg, var(--neon-blue), var(--neon-purple));
    color: white;
    box-shadow: 0 0 20px rgba(77, 77, 255, 0.4);
}

.btn-primary:hover {
    box-shadow: 0 0 30px rgba(188, 19, 254, 0.6);
    transform: translateY(-2px);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-main);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: var(--text-main);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.2);
}

.btn-danger {
    background: linear-gradient(90deg, #ff416c, #ff4b2b);
    color: white;
    box-shadow: 0 0 20px rgba(255, 75, 43, 0.4);
}

.btn-danger:hover {
    box-shadow: 0 0 30px rgba(255, 65, 108, 0.6);
    transform: translateY(-2px);
}

/* Upload Zone */
.upload-section {
    margin: 2rem 0;
}

.upload-zone {
    border: 2px dashed rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-lg);
    padding: 4rem;
    text-align: center;
    background: rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.upload-zone:hover {
    border-color: var(--neon-cyan);
    background: rgba(0, 242, 255, 0.05);
    box-shadow: inset 0 0 30px rgba(0, 242, 255, 0.1);
}

.upload-zone.dragover {
    border-color: var(--neon-purple);
    background: rgba(188, 19, 254, 0.05);
}

.upload-icon {
    font-size: 4rem;
    margin-bottom: 1.5rem;
    opacity: 0.8;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
}

.upload-hint {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: 0.75rem;
}

/* Upload List */
.upload-list {
    margin-top: 2rem;
}

.upload-item {
    background: rgba(255, 255, 255, 0.05);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
}

.upload-item-name {
    font-weight: 600;
    color: var(--text-main);
}

.upload-item-status {
    font-size: 0.85rem;
    font-weight: 500;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    background: rgba(0, 0, 0, 0.3);
    color: var(--text-muted);
}

    height: 48px;
    font-weight: 700;
    color: #00ff88;
    border: 1px solid rgba(0, 255, 136, 0.2);
}

.upload-item-status.error {
    background: rgba(255, 75, 43, 0.1);
    color: #ff4b2b;
    border: 1px solid rgba(255, 75, 43, 0.2);
}

.progress-bar {
    height: 6px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--neon-cyan), var(--neon-blue));
    box-shadow: 0 0 10px var(--neon-cyan);
    transition: width 0.3s ease;
}

/* Filters */
.filters {
    background: rgba(20, 20, 40, 0.6);
    backdrop-filter: blur(16px);
    padding: 2rem;
    border-radius: var(--radius-lg);
    margin-bottom: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.filter-group label {
    color: var(--text-muted);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.filter-group input,
.filter-group select {
    width: 100%;
    padding: 0.85rem 1rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    background: rgba(0, 0, 0, 0.3);
    color: var(--text-main);
    transition: all 0.2s;
}

.filter-group input:focus,
.filter-group select:focus {
    outline: none;
    border-color: var(--neon-cyan);
    box-shadow: 0 0 15px rgba(0, 242, 255, 0.2);
    background: rgba(0, 0, 0, 0.5);
}

/* Assets Grid */
.assets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.5rem;
}

.asset-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    position: relative;
}

.asset-card:hover {
    transform: translateY(-6px);
    border-color: var(--neon-purple);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 20px rgba(188, 19, 254, 0.2);
}

.card-image-wrapper {
    position: relative;
    width: 100%;
    height: clamp(160px, 18vw, 260px);
    background: rgba(0, 0, 0, 0.15);
    border-radius: var(--radius-sm);
    overflow: hidden;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
}

.asset-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
    padding: 0;
    background: transparent;
    opacity: 0;
    transition: opacity 140ms ease;
    will-change: opacity;
}

.asset-thumbnail video,
.asset-thumbnail-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.asset-thumbnail.is-loaded {
    opacity: 1;
}

.card-actions {
    position: absolute;
    bottom: 10px;
    right: 10px;
    z-index: 10;
}

/* Delete overlay in top-right of thumbnail */
.card-delete-overlay {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 12;
}

.delete-x-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(0,0,0,0.60);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.25);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.delete-x-btn:hover {
    background: rgba(255, 77, 79, 0.9);
    border-color: rgba(255,255,255,0.35);
}

/* Archived toggle button in toolbar */
#toggleTrashBtn.archived-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0 14px;
    height: 42px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.18);
    background: rgba(255,255,255,0.06);
    color: rgba(255,255,255,0.9);
    cursor: pointer;
    white-space: nowrap;
}

#toggleTrashBtn.archived-toggle:hover {
    background: rgba(255,255,255,0.10);
}

#toggleTrashBtn.archived-toggle.active {
    background: rgba(255,255,255,0.14);
    border-color: rgba(255,255,255,0.30);
}

.btn-icon-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-icon-circle:hover {
    background: var(--neon-cyan);
    border-color: var(--neon-cyan);
    box-shadow: 0 0 10px rgba(0, 242, 255, 0.4);
    transform: scale(1.1);
}

.download-wrapper {
    position: relative;
}

.download-dropdown {
    position: absolute;
    bottom: 100%;
    right: 0;
    background: #1a1a2e;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sm);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
    width: 180px;
    display: none;
    flex-direction: column;
    z-index: 20;
    margin-bottom: 8px;
    overflow: hidden;
}

.download-dropdown.active {
    display: flex;
}

.dropdown-item {
    padding: 0.75rem 1rem;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.2s;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

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

.dropdown-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.asset-info {
    padding: 1.25rem;
}

.asset-title {
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 0.25rem;
    font-size: 1.1rem;
}

.ai-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.7rem;
    margin-left: 6px;
    vertical-align: middle;
    background: rgba(0, 242, 255, 0.1);
    color: var(--neon-cyan);
    border: 1px solid rgba(0, 242, 255, 0.3);
}

.ai-badge.failed {
    background: rgba(255, 75, 43, 0.15);
    color: #ff4b2b;
    border-color: rgba(255, 75, 43, 0.35);
}

.ai-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-top-color: var(--neon-cyan);
    border-radius: 50%;
    animation: ai-spin 0.8s linear infinite;
    display: inline-block;
}

.ai-spinner.is-hidden {
    display: none;
}

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

.asset-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    row-gap: 0.5rem;
    min-height: 0;
}

.asset-description-preview {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.asset-tag {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-main);
    transition: all 0.2s;
    line-height: 1;
    height: 28px;
    margin: 0;
}

.asset-tag:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: var(--neon-cyan);
    border: 1px solid rgba(255, 255, 255, 0.18);
}
.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.12);
}

/* === CARD DENSITY + TAG CLAMP + DROPDOWN CLIP FIX === */

/* 1) Hide the date on smaller / tighter layouts */
@media (max-width: 1100px) {
    .asset-date,
    .asset-meta-date,
    .asset-card .date,
    .asset-card .created-date {
        display: none !important;
    }
}

/* 2) Limit visible tags to 2 rows (prevents tall cards) */
.asset-card .tag-row,
.asset-card .asset-tags,
.asset-card .tags,
.asset-card .asset-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    max-height: calc((28px * 2) + 8px);
    overflow: hidden;
}

/* If your chips are taller/shorter, tweak 28px above */
.asset-card .tag,
.asset-card .chip,
.asset-card .tag-pill,
.asset-card .asset-tag {
    height: 28px;
    line-height: 28px;
    white-space: nowrap;
}

.asset-type {
    background: rgba(77, 77, 255, 0.2);
    color: #a3a3ff;
    border-color: rgba(77, 77, 255, 0.3);
}

.asset-location {
    background: rgba(0, 255, 136, 0.1);
    color: #00ff88;
    border-color: rgba(0, 255, 136, 0.2);
}

.tag-remove {
    margin-left: 6px;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.5);
}

.tag-remove:hover {
    color: #ff4b2b;
}

.tag-add {
    cursor: pointer;
    background: transparent;
    color: var(--neon-cyan);
    border: 1px dashed var(--neon-cyan);
    height: 28px;
}

.tag-add:hover {
    background: rgba(0, 242, 255, 0.1);
    box-shadow: 0 0 10px rgba(0, 242, 255, 0.2);
}

/* Modal */
.modal {
    display: none; /* Hidden by default */
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    /* Flexbox centering */
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex; /* Changed from block to flex for centering */
}

.modal-content {
    background: #1a1a2e;
    background: linear-gradient(145deg, #1a1a2e 0%, #16213e 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.5), 0 0 20px rgba(77, 77, 255, 0.1);
    border-radius: var(--radius-lg); /* Enforce rounded corners */
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    margin: 0 20px; /* Prevent touching edges on mobile */
}

.modal-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1.5rem 2rem; /* Increased padding */
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.modal-body {
    display: flex;
    flex-direction: column;
    overflow: auto;
    padding: 0;
}

.ai-status-row {
    margin-top: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.ai-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.ai-status.failed {
    color: #ff4b2b;
}

.ai-status.complete {
    color: #00ff88;
}

.asset-modal #assetDescriptionSaveBtn[disabled],
.asset-modal #assetDescriptionInput[disabled] {
    opacity: 0.6;
    cursor: not-allowed;
}

.asset-modal #assetDetails {
    height: 100%;
    overflow: hidden;
}

.asset-modal .asset-detail-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    min-width: 0;
}

.modal-header h3 {
    color: var(--text-main);
    margin: 0;
    font-size: 1.5rem;
}

.close {
    color: var(--text-muted);
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s;
}

.close:hover {
    color: #ff4b2b;
    background: rgba(255, 75, 43, 0.1);
}

/* Form Inputs in Modal */
.form-row {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.upload-meta-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    align-items: end;
    margin-bottom: 0.75rem;
}

@media (max-width: 700px) {
    .upload-meta-row {
        grid-template-columns: 1fr;
    }
}

.upload-meta-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.upload-meta-field label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.upload-meta-field select,
.upload-tags-input {
    height: 48px;
}

.upload-tags-input {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 12px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.3);
    min-height: 48px;
}

.upload-tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

/* Smart Tag Input */
.inline-tag-input-container {
    display: inline-flex;
    align-items: center;
    height: 28px;
    vertical-align: middle;
    position: relative;
}

.inline-tag-input {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--neon-cyan);
    border-radius: 20px;
    color: var(--text-main);
    padding: 0 0.75rem;
    font-size: 0.75rem;
    width: 100px;
    outline: none;
    transition: all 0.2s;
    height: 28px;
    line-height: 28px;
}

.inline-tag-input:focus {
    box-shadow: 0 0 10px rgba(0, 242, 255, 0.1);
    background: rgba(0, 0, 0, 0.5);
}
.tag-chip {
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.tag-chip .remove-tag {
    cursor: pointer;
    color: rgba(255, 255, 255, 0.7);
    font-weight: bold;
    line-height: 1;
}

.tag-chip .remove-tag:hover {
    color: #fff;
}

.tag-input-field {
    background: transparent;
    border: none;
    color: var(--text-main);
    flex: 1;
    min-width: 120px;
    outline: none;
    padding: 0.25rem;
}

.tag-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(20, 20, 30, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sm);
    margin-top: 4px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 2000;
    backdrop-filter: blur(10px);
    display: none;
}

.tag-suggestions.active {
    display: block;
}

.tag-suggestion-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.2s ease;
}

.tag-suggestion-item:hover,
.tag-suggestion-item.selected {
    background: rgba(188, 19, 254, 0.2);
    color: #fff;
}

.form-row.two-col .form-group {
    flex: 1;
}

.form-group.full-width {
    width: 100%;
}

.form-group {
    margin-bottom: 0; /* Reset default margin */
}

.form-group label {
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    display: block;
    font-size: 0.9rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-main);
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--neon-purple);
    box-shadow: 0 0 15px rgba(188, 19, 254, 0.2);
    outline: none;
}

.form-actions {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 1.5rem;
    margin-top: 1rem;
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

.asset-modal .asset-actions {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    flex-wrap: wrap;
}

.asset-modal .asset-actions__left {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1 1 520px;
    min-width: 0;
}

.asset-modal .asset-actions__right {
    display: flex;
    align-items: flex-start;
}

.asset-modal .asset-actions__buttons {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

@media (max-width: 700px) {
    .asset-modal .asset-actions__buttons {
        grid-template-columns: 1fr;
    }
}

.asset-modal .asset-status {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.asset-modal .status-pill {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.18);
    font-size: 0.8rem;
    font-weight: 600;
    color: #ffffff;
}

.asset-modal .status-pill--pending {
    background: rgba(77, 77, 255, 0.18);
    border-color: rgba(77, 77, 255, 0.45);
}

.asset-modal .status-pill--error {
    background: rgba(255, 75, 43, 0.18);
    border-color: rgba(255, 75, 43, 0.45);
}

/* Asset Details - Tight Layout */
:is(.asset-modal, .upload-modal) .asset-media-row {
    flex: 1 1 auto; /* Allow shrinking */
    min-height: 0; /* Crucial for shrinking */
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    width: 100%;
    max-width: 100%;
    height: clamp(220px, 45vh, 420px);
    overflow: hidden;
}

:is(.asset-modal, .upload-modal) .asset-media-content {
    display: block;
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: var(--radius-sm);
}

:is(.asset-modal, .upload-modal) .asset-media-row video,
:is(.asset-modal, .upload-modal) .asset-media-row img,
:is(.asset-modal, .upload-modal) .asset-media-row iframe {
    display: block;
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}

:is(.asset-modal, .upload-modal) .asset-content-rows {
    flex: 0 0 auto; /* Fixed height for content rows */
    padding: 1rem;
    background: var(--bg-card);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

:is(.asset-modal, .upload-modal) .asset-input {
    width: 100%;
    height: 48px;
    padding: 0 14px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(0, 0, 0, 0.3);
    color: var(--text-main);
}

:is(.asset-modal, .upload-modal) .asset-input:focus {
    border-color: var(--neon-purple);
    box-shadow: 0 0 12px rgba(188, 19, 254, 0.2);
    outline: none;
}

.asset-modal .asset-save-status {
    margin-top: 8px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.asset-modal .asset-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 0.75rem;
}

.asset-modal .asset-footer__left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.asset-modal .asset-footer .btn {
    height: 56px;
    border-radius: 999px;
}

/* Row 2: Metadata */
:is(.asset-modal, .upload-modal) .compact-metadata-row {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1rem;
}

:is(.asset-modal, .upload-modal) .asset-meta-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    align-items: end;
    margin-bottom: 0.75rem;
}

@media (max-width: 700px) {
    :is(.asset-modal, .upload-modal) .asset-meta-row {
        grid-template-columns: 1fr;
    }
}

:is(.asset-modal, .upload-modal) .asset-meta-row .field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

:is(.asset-modal, .upload-modal) .asset-meta-row .field-tags {
    grid-column: 1 / -1;
}

:is(.asset-modal, .upload-modal) .asset-meta-row .metadata-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

:is(.asset-modal, .upload-modal) .asset-meta-row .compact-select,
:is(.asset-modal, .upload-modal) .asset-meta-row .tags-input {
    height: 48px;
}

:is(.asset-modal, .upload-modal) .tags-input {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 12px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.3);
    min-height: 48px;
}

:is(.asset-modal, .upload-modal) .tags-input .tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

/* Asset modal tags row (inline chips) */
:is(.asset-modal, .upload-modal) .tags-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

:is(.asset-modal, .upload-modal) .tags-row .inline-tag-input-container,
:is(.asset-modal, .upload-modal) .asset-meta .inline-tag-input-container {
    flex: 1 1 140px;
    min-width: 80px;
    max-width: 180px;
}

:is(.asset-modal, .upload-modal) .tags-row .inline-tag-input,
:is(.asset-modal, .upload-modal) .asset-meta .inline-tag-input {
    width: 100%;
}

:is(.asset-modal, .upload-modal) .meta-chip {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.14);
    font-weight: 700;
    color: var(--text-main);
    font-size: 0.8rem;
}

:is(.asset-modal, .upload-modal) .meta-chip.locked {
    opacity: 0.9;
}

:is(.asset-modal, .upload-modal) .add-tag-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 999px;
    border: 1px dashed rgba(255, 255, 255, 0.4);
    background: transparent;
    color: var(--text-main);
    cursor: pointer;
}

:is(.asset-modal, .upload-modal) .description-row {
    margin-top: 0.5rem;
}

.metadata-group-main {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.metadata-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.metadata-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.compact-select {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-main);
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
}

.tags-container {
    flex: 1;
    min-width: 0; /* Allow shrinking */
}

.tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* Row 3: Description */
:is(.asset-modal, .upload-modal) .description-row {
    margin-bottom: 1rem;
}

:is(.asset-modal, .upload-modal) .compact-textarea {
    width: 100%;
    height: 80px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-main);
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    resize: none;
    font-family: inherit;
}

/* Row 4: Buttons */
.compact-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-md {
    padding: 0.6rem 1.2rem;
    font-size: 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Mobile Layout */
@media (max-width: 600px) {
    .compact-metadata-row {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }

    .metadata-group-main {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
    }

    .metadata-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }

    .compact-select {
        width: 100%;
    }

    .tags-list {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 0.25rem;
        -webkit-overflow-scrolling: touch;
    }

    .asset-tag {
        flex: 0 0 auto;
    }

    .compact-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
        position: sticky;
        bottom: 0;
        background: var(--bg-card);
        padding-top: 1rem;
        border-top: 1px solid rgba(255, 255, 255, 0.05);
        margin-bottom: -1rem; /* Offset parent padding */
        padding-bottom: 1rem; /* Add padding back */
    }

    .primary-download-btn {
        grid-column: 1 / -1; /* Download Asset full width */
    }
}

.detail-label {
    color: var(--text-dim);
}

.detail-value {
    color: var(--text-main);
}

/* Debug Footer */
.debug-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 900;
    display: flex;
    flex-direction: column;
    pointer-events: auto;
}

.debug-toggle-btn {
    width: 100%;
    background: #0a0a12;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-left: none;
    border-right: none;
    border-bottom: none;
    color: var(--text-muted);
    padding: 0.5rem 1rem;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.debug-toggle-btn:hover {
    color: var(--neon-cyan);
    background: #161625;
}

.debug-panel {
    width: 100%;
    height: 300px;
    background: #0a0a12 !important;
    border-top: 1px solid var(--neon-cyan);
    padding: 0;
    display: flex;
    flex-direction: column;
    pointer-events: auto;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateY(0);
}

.debug-panel.collapsed {
    transform: translateY(100%);
    display: none !important;
}

.debug-header {
    padding: 0.75rem 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    color: var(--neon-cyan);
    font-size: 0.9rem;
}

#debugLog {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 1.5rem;
    color: #00ff88;
    font-family: 'Fira Code', monospace;
    font-size: 0.85rem;
    margin: 0;
}

/* Toast Notification */
.toast-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2000;
    pointer-events: none;
}

.toast {
    background: rgba(16, 185, 129, 0.9);
    backdrop-filter: blur(10px);
    color: white;
    padding: 1rem 2rem;
    border-radius: 50px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    margin-bottom: 1rem;
    opacity: 0;
    transform: translateY(-20px);
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 500;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast-icon {
    font-size: 1.2rem;
}

/* Inline Tag Input */
.inline-tag-input-container {
    display: inline-block;
    vertical-align: middle;
    position: relative;
}

.inline-tag-input {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--neon-cyan);
    border-radius: 20px;
    color: var(--text-main);
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    width: 100px;
    outline: none;
    transition: all 0.2s;
}

.inline-tag-input:focus {
    box-shadow: 0 0 10px rgba(0, 242, 255, 0.2);
    background: rgba(0, 0, 0, 0.5);
}

/* Multi-select Dropdown */
.multi-select-container {
    position: relative;
    width: 100%;
}

.selected-tags-display {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sm);
    padding: 0.5rem;
    min-height: 46px;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
}

.selected-tags-display:hover {
    border-color: rgba(255, 255, 255, 0.3);
    background: rgba(0, 0, 0, 0.4);
}

.selected-tags-display .placeholder {
    color: var(--text-dim);
    padding: 0.25rem;
}

.tag-chip-small {
    background: rgba(188, 19, 254, 0.2);
    border: 1px solid rgba(188, 19, 254, 0.4);
    color: #fff;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.tag-chip-small .remove {
    cursor: pointer;
    font-weight: bold;
    opacity: 0.7;
}

.tag-chip-small .remove:hover {
    opacity: 1;
}

.multi-select-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: #1a1a2e;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sm);
    margin-top: 4px;
    max-height: 250px;
    overflow-y: auto;
    z-index: 100;
    display: none;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

/* 3) Tags+ dropdown getting cut off: overflow + stacking context fixes */
.filters-bar,
.filter-row,
.filter-toolbar,
.search-toolbar,
.search-row,
.filters-row,
.filter-toolbar-container,
.searchbar-row,
.searchbar {
    overflow: visible !important;
}

.main-content,
.main-container,
.library-header,
.header-content {
    overflow: visible !important;
}

.tag-dropdown,
.tags-dropdown,
.filter-dropdown,
.dropdown-menu,
.multi-select-dropdown {
    position: absolute;
    z-index: 300;
}

.filters-bar,
.filter-row,
.filter-toolbar,
.search-toolbar,
.search-row,
.filter-toolbar-container {
    position: relative;
    z-index: 200;
}

.multi-select-dropdown.active {
    display: block;
}

.dropdown-item {
    padding: 0.75rem 1rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

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

.dropdown-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
}

.dropdown-item.selected {
    background: rgba(188, 19, 254, 0.1);
    color: var(--neon-cyan);
    font-weight: 500;
}

.dropdown-item.disabled {
    color: var(--text-dim);
    cursor: default;
    font-style: italic;
}

/* Compact Filter Toolbar */
.filter-toolbar-container {
    position: sticky;
    top: 70px; /* Adjust based on nav height */
    z-index: 90;
    margin-bottom: 1.5rem;
    width: 100%;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.searchbar-row {
    width: 100%;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 0.5rem;
}

.searchbar {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    background: rgba(26, 26, 46, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    padding: 0.35rem 0.5rem;
}

.searchbar-icon {
    opacity: 0.7;
    margin-left: 0.35rem;
}

.searchbar-input {
    flex: 1 1 auto;
    min-width: 0;
    height: 40px;
    border: none;
    outline: none;
    background: transparent;
    color: var(--text-main);
    font-size: 0.95rem;
    padding: 0 0.25rem;
}

.searchbar-input::placeholder {
    color: var(--text-muted);
    opacity: 0.8;
}

.searchbar-action {
    width: 36px;
    height: 36px;
    border-radius: 999px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.searchbar-action:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-main);
}

.searchbar-action:focus {
    outline: none;
    border-color: var(--neon-cyan);
    box-shadow: 0 0 0 2px rgba(0, 242, 255, 0.15);
}

.searchbar-action.is-open {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.18);
    color: var(--text-main);
}

.filters-drawer {
    width: 100%;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    background: rgba(26, 26, 46, 0.55);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-sm);
    padding: 0.6rem 0.75rem;
    overflow: visible !important;
    position: relative;
    z-index: 10001;
}

.filters-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 0.75rem;
    align-items: center;
}

.filters-row .filter-item {
    display: flex;
    align-items: center;
}

.filters-row .compact-select,
.filters-row .compact-tag-trigger {
    height: 36px;
    border-radius: 999px;
}

.filters-drawer[hidden] {
    display: none;
}

.filter-toolbar {
    display: grid;
    grid-template-columns: repeat(3, minmax(140px, 1fr)) minmax(100px, 0.8fr) 1.5fr 40px;
    gap: 0.75rem;
    background: rgba(26, 26, 46, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 0.75rem;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.1);
    align-items: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.filter-toolbar--search {
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.filter-toolbar--filters {
    justify-content: flex-start;
}

.compact-input--search {
    height: 40px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.05);
}

.filter-toolbar--search .compact-input--search:focus {
    background: rgba(255, 255, 255, 0.06);
}

.filter-item {
    position: relative;
}

.tag-trigger-wrapper {
    position: relative;
    z-index: 10002;
}

.compact-select,
.compact-input,
.compact-tag-trigger {
    width: 100%;
    height: 38px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: var(--text-main);
    font-size: 0.9rem;
    padding: 0 0.75rem;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    cursor: pointer;
}

.compact-select:focus,
.compact-input:focus,
.compact-tag-trigger:hover {
    border-color: var(--neon-cyan);
    background: rgba(255, 255, 255, 0.1);
    outline: none;
}

.compact-tag-trigger {
    justify-content: center;
    color: var(--text-muted);
    font-weight: 500;
}

.compact-tag-trigger:hover {
    color: var(--neon-cyan);
}

.compact-select.is-active {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.18);
    color: var(--text-main);
}

.btn-icon {
    width: 38px;
    height: 38px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-icon:hover {
    background: rgba(255, 50, 50, 0.2);
    color: #ff4444;
}

/* Active Tags Row */
.active-tags-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: rgba(0, 0, 0, 0.2);
    border-bottom-left-radius: var(--radius-sm);
    border-bottom-right-radius: var(--radius-sm);
    margin-top: -2px; /* Connect to toolbar */
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-top: none;
}

/* Responsive adjustments */
@media (max-width: 900px) {
    .filter-toolbar {
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
    }
    .search-item {
        grid-column: 1 / -2;
    }
    .action-item {
        grid-column: -1;
    }
}

@media (max-width: 600px) {
    .filter-toolbar {
        grid-template-columns: 1fr;
    }
    .search-item, .action-item {
        grid-column: auto;
    }

    .filter-toolbar--search .search-item {
        flex: 1 1 100%;
        min-width: 0;
    }
}

/* Upload Progress Bar */
.progress-container {
    width: 100%;
    margin-top: 1rem;
}

.progress-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.progress-bar-bg {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--neon-cyan), var(--neon-purple));
    width: 0%;
    transition: width 0.2s ease;
    box-shadow: 0 0 10px rgba(0, 243, 255, 0.5);
}


/* Inline Editing */
.inline-edit-input,
.inline-edit-textarea {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-main);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    width: 100%;
    font-family: inherit;
    font-size: inherit;
    transition: all 0.2s;
}

.inline-edit-input:hover,
.inline-edit-textarea:hover {
    border-color: rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
}

.inline-edit-input:focus,
.inline-edit-textarea:focus {
    border-color: var(--neon-cyan);
    background: rgba(0, 0, 0, 0.3);
    outline: none;
    box-shadow: 0 0 10px rgba(0, 242, 255, 0.1);
}

.inline-edit-textarea {
    resize: vertical;
    min-height: 60px;
}

/* Custom Delete Modal */
#deleteConfirmModal .modal-content {
    background: #1a1a2e;
    border: 1px solid rgba(255, 75, 43, 0.3);
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.8), 0 0 20px rgba(255, 75, 43, 0.1);
}

#deleteConfirmModal .btn-danger {
    background: linear-gradient(135deg, #ff4b2b 0%, #ff416c 100%);
    border: none;
    box-shadow: 0 4px 15px rgba(255, 75, 43, 0.3);
}

#deleteConfirmModal .btn-danger:hover {
    box-shadow: 0 6px 20px rgba(255, 75, 43, 0.5);
    transform: translateY(-1px);
}

/* Upload card overlays */
.upload-card.ai-pending {
    filter: grayscale(0.7);
    opacity: 0.75;
}

.upload-card.is-blocked {
    filter: grayscale(0.7);
    opacity: 0.7;
}

.upload-card.is-blocked .asset-media-row,
.upload-card.is-blocked .asset-content-rows {
    pointer-events: none;
}

.upload-card.show-duplicate .card-overlay {
    display: none;
}

.upload-card .duplicate-actions {
    position: absolute;
    inset: 0;
    z-index: 7;
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 12px;
    pointer-events: auto;
    background: rgba(10, 10, 20, 0.6);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

.card-overlay {
    position: absolute;
    inset: 0;
    background: rgba(10, 10, 20, 0.6);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 6;
    pointer-events: all;
}

.upload-card.is-blocked .card-overlay {
    display: flex;
}

.card-overlay-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.card-overlay .spinner {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-top-color: var(--neon-cyan);
    animation: ai-spin 1s linear infinite;
}

.card-overlay-text {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.9);
}

.upload-card .ai-overlay {
    position: absolute;
    inset: 0;
    background: rgba(10, 10, 20, 0.55);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 12px;
    z-index: 5;
    pointer-events: all;
}

.ai-overlay-spinner {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-top-color: var(--neon-cyan);
    animation: ai-spin 1s linear infinite;
}

.ai-overlay-text {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.9);
}

.metadata-form.ai-disabled {
    pointer-events: none;
}

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

.upload-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.upload-card .upload-tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.upload-card .upload-tags-list .asset-tag {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.14);
    font-weight: 700;
    color: var(--text-main);
    font-size: 0.8rem;
}

.upload-status-badge {
    font-size: 0.8rem;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
}

.upload-status-badge.uploading {
    background: rgba(0, 242, 255, 0.1);
    color: var(--neon-cyan);
    border: 1px solid rgba(0, 242, 255, 0.3);
}

.upload-status-badge.ready {
    background: rgba(0, 255, 157, 0.1);
    color: var(--neon-green);
    border: 1px solid rgba(0, 255, 157, 0.3);
}

.upload-status-badge.error {
    background: rgba(255, 75, 43, 0.1);
    color: var(--neon-red);
    border: 1px solid rgba(255, 75, 43, 0.3);
}

/* Form Layout Improvements */
.form-row-inline {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.form-row-inline label {
    min-width: 120px;
    margin-bottom: 0;
}

.form-row-inline input {
    flex: 1;
}

/* Sticky Footer */
.sticky-footer {
    position: sticky;
    bottom: 0;
    background: var(--bg-dark);
    padding: 1rem 0;
    margin-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 10;
    display: flex;
    justify-content: flex-end;
}

/* Progress Bar in Card */
.card-progress-container {
    margin-top: 1rem;
}

.card-progress-bar {
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
}

.card-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--neon-cyan), var(--neon-purple));
    width: 0%;
    transition: width 0.3s ease;
}

.card-progress-text {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
    text-align: right;
}

/* Multi-File Upload Styles */
.modal-large {
    width: 95%; /* Use almost full width */
    max-width: 1600px; /* Allow much wider on large screens */
    height: 90vh; /* Use more vertical space */
    display: flex;
    flex-direction: column;
}

.modal-body {
    flex: 1;
    overflow-y: hidden; /* Prevent body itself from scrolling */
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 0; /* Remove padding from body, move to scroll container */
}

.modal-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    padding-bottom: 1rem;
}

.multi-upload-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(420px, 1fr));
    gap: 1.25rem;
    /* Padding bottom handled by modal-scroll */
}

.upload-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
    position: relative;
}

.upload-card:hover {
    border-color: var(--neon-purple);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.file-icon {
    font-size: 3rem;
    opacity: 0.5;
}

.upload-card .upload-card-preview {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.upload-card .upload-card-preview img,
.upload-card .upload-card-preview video {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}


.card-progress-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.card-progress-bar {
    flex: 1;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
}

.card-progress-fill {
    height: 100%;
    width: 0%;
    background: var(--neon-cyan);
    transition: width 0.2s ease;
}

.card-progress-text {
    font-size: 0.75rem;
    color: var(--text-muted);
    width: 30px;
    text-align: right;
}

.form-row-inline {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.form-row-inline.compact-row {
    justify-content: flex-start;
    gap: 1.5rem; /* Space between Location and Type groups */
}

.inline-field {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.inline-field label {
    color: var(--text-muted);
    font-size: 0.9rem;
    white-space: nowrap;
}

.inline-field select {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    padding: 0.4rem 0.6rem;
    color: var(--text-main);
    font-size: 0.9rem;
    min-width: 120px;
}

.form-row-inline label {
    min-width: auto; /* Allow label to shrink */
    color: var(--text-muted);
    font-size: 0.9rem;
    white-space: nowrap;
}

.form-row-inline input {
    flex: 1;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    padding: 0.5rem;
    color: var(--text-main);
    font-size: 0.9rem;
}

.form-row.two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-group label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.3rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sm);
    padding: 0.5rem;
    color: var(--text-main);
    font-size: 0.9rem;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--neon-cyan);
    background: rgba(0, 0, 0, 0.4);
}

.tag-input-container {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sm);
    padding: 0.3rem;
    min-height: 38px;
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
}

.tag-input-field {
    border: none !important;
    background: transparent !important;
    padding: 0.2rem !important;
    flex: 1;
    min-width: 80px;
}

.tag-chip {
    background: rgba(188, 19, 254, 0.2);
    border: 1px solid rgba(188, 19, 254, 0.3);
    color: #e0aaff;
    padding: 0.1rem 0.5rem;
    border-radius: 12px;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.tag-chip span {
    cursor: pointer;
    font-weight: bold;
    opacity: 0.7;
}

.tag-chip span:hover {
    opacity: 1;
}

.sticky-footer {
    position: relative; /* Not sticky/fixed */
    flex-shrink: 0;
    background: var(--bg-dark);
    padding: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
    box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.5);
}

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

.btn-icon:hover {
    color: #ff4b2b;
}

/* Tag Autocomplete Styles */
.tag-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-dark);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0 0 6px 6px;
    max-height: 150px;
    overflow-y: auto;
    z-index: 2000;
    display: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.tag-suggestion-item {
    padding: 0.5rem 1rem;
    cursor: pointer;
    color: var(--text-main);
    transition: background 0.2s;
}

.tag-suggestion-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--neon-cyan);
}

/* Inline Tag Input Container */
.inline-tag-input-container {
    position: relative; /* Anchor for absolute positioning of suggestions */
    display: inline-flex;
    align-items: center;
    min-width: 120px;
    height: 28px;
}

.inline-tag-input {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-main);
    padding: 0 0.5rem;
    border-radius: 4px;
    width: 100%;
    outline: none;
    height: 28px;
    line-height: 28px;
}

.inline-tag-input:focus {
    border-color: var(--neon-cyan);
    box-shadow: 0 0 5px rgba(0, 242, 255, 0.2);
}

/* Scoped Settings Page Styles */
.settings-page .card {
    padding: 1.5rem;
}

.settings-page .card-header {
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.settings-page .card-header h5 {
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
}

.settings-page .card-header small {
    font-size: 0.85rem;
}

.settings-page .settings-input-group {
    display: flex;
    width: 100%;
}

.settings-page .settings-input {
    height: 44px;
    font-size: 0.9rem;
    border-radius: 50px 0 0 50px;
    flex: 1;
    border-right: none;
}

.settings-page .settings-add-btn {
    height: 44px;
    padding: 0 1.5rem;
    font-size: 0.9rem;
    border-radius: 0 50px 50px 0;
    width: auto;
    max-width: none;
    min-width: auto;
    margin-top: 0;
    white-space: nowrap;
}

.settings-page #sync-tags-btn {
    height: 32px;
    padding: 0 1rem;
    font-size: 0.8rem;
    border-radius: 50px;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.settings-chip {
    display: inline-flex;
    align-items: center;
    background-color: #6c757d;
    color: white;
    padding: 8px 12px;
    border-radius: 999px;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
    font-size: 14px;
    width: auto;
    line-height: 1.2;
}

.settings-chip span {
    margin-right: 0.5rem;
}

.settings-delete-btn {
    background: transparent;
    border: none;
    padding: 0;
    margin: 0 0 0 4px;
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    font-weight: bold;
    font-size: 1.1rem;
    line-height: 1;
    z-index: 10;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    transition: color 0.2s;
}

.settings-delete-btn:hover {
    color: #ff6b6b;
}

/* Compact Toast */
.toast-container .toast {
    font-size: 14px;
    max-width: 420px;
    border-radius: 12px;
}

.toast-container .toast-body {
    padding: 10px 14px;
}

.toast-container .btn-close {
    padding: 0.5rem;
}

/* super_admin client management */
.admin-clients-layout {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 24px;
}

.admin-panel {
    background: rgba(14, 16, 24, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}

.admin-panel-header {
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.admin-panel-body {
    padding: 18px 20px;
}

.admin-search-input {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #fff;
    margin-bottom: 16px;
}

.admin-org-results {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 520px;
    overflow-y: auto;
}

.admin-org-card {
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
    cursor: pointer;
    transition: border 0.2s ease, background 0.2s ease;
}

.admin-org-card.active {
    border-color: rgba(0, 242, 255, 0.6);
    background: rgba(0, 242, 255, 0.08);
}

.admin-org-card-title {
    font-weight: 600;
    color: #fff;
}

.admin-org-card-meta {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 4px;
}

.admin-org-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    font-size: 12px;
}

.admin-status-pill {
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(67, 160, 71, 0.2);
    color: #c8f5d5;
    font-size: 12px;
    text-transform: capitalize;
}

.admin-status-pill.suspended {
    background: rgba(255, 193, 7, 0.2);
    color: #ffe8a1;
}

.admin-status-pill.deleted {
    background: rgba(244, 67, 54, 0.2);
    color: #ffb5ad;
}

.admin-org-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 16px;
}

.admin-label {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.admin-value {
    font-size: 14px;
    color: #fff;
    margin-top: 4px;
}

.admin-progress {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    margin-top: 8px;
    overflow: hidden;
}

.admin-progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #00f2ff, #3d7bff);
}

.admin-users-table {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.admin-user-row {
    display: grid;
    grid-template-columns: 1.2fr 1.3fr auto;
    gap: 16px;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
}

.admin-user-name {
    font-weight: 600;
    color: #fff;
}

.admin-user-email {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
}

.admin-user-meta {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.admin-user-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    justify-content: center;
}

.admin-user-memberships {
    margin-top: 16px;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
}

.admin-memberships-title {
    font-weight: 600;
    margin-bottom: 8px;
}

.admin-billing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
}

.admin-billing-actions {
    margin-top: 16px;
    display: flex;
    gap: 10px;
}

.admin-confirm-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 9998;
}

.admin-confirm-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #1b1f2a;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    padding: 20px;
    width: min(420px, 92vw);
    z-index: 9999;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.admin-confirm-modal h5 {
    color: #fff;
    margin-bottom: 10px;
}

@media (max-width: 992px) {
    .admin-clients-layout {
        grid-template-columns: 1fr;
    }
    .admin-org-results {
        max-height: 320px;
    }
    .admin-user-row {
        grid-template-columns: 1fr;
    }
}

/* Asset modal title inline edit */
.asset-modal .modal-title-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.asset-modal .modal-title-text {
    font-size: 32px;
    font-weight: 800;
    letter-spacing: 0.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
}

.asset-modal .title-edit-btn {
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    height: 34px;
    width: 34px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.asset-modal .title-edit-btn:hover {
    background: rgba(255, 255, 255, 0.12);
}

.asset-modal .modal-title-input {
    font-size: 28px;
    font-weight: 800;
    color: #fff;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 12px;
    padding: 8px 12px;
    width: min(640px, 60vw);
    outline: none;
}

.asset-modal .modal-title-input:focus {
    border-color: rgba(168, 85, 247, 0.7);
    box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.18);
}

.asset-modal .title-saving {
    opacity: 0.7;
    pointer-events: none;
}

.asset-modal .title-saving-indicator {
    font-size: 12px;
    opacity: 0.7;
    margin-left: 6px;
}
