/* ================================================
   AssetHub — Digital Asset Management
   Modern, responsive UI
   ================================================ */

:root {
  --bg: #f7f8fb;
  --bg-card: #ffffff;
  --bg-sidebar: #0f1120;
  --bg-sidebar-hover: rgba(255,255,255,0.06);
  --bg-sidebar-active: rgba(99,102,241,0.18);
  --border: #e6e8ef;
  --border-strong: #d5d8e2;
  --text: #0f172a;
  --text-muted: #64748b;
  --text-soft: #94a3b8;
  --text-on-dark: #e2e8f0;
  --text-on-dark-muted: #94a3b8;
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --primary-soft: #eef2ff;
  --accent-pink: #ec4899;
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  --accent-red: #ef4444;
  --accent-violet: #8b5cf6;
  --accent-blue: #3b82f6;
  --accent-teal: #14b8a6;
  --shadow-sm: 0 1px 2px rgba(15,23,42,0.06);
  --shadow: 0 4px 12px rgba(15,23,42,0.06);
  --shadow-lg: 0 20px 50px rgba(15,23,42,0.18);
  --radius: 12px;
  --radius-lg: 16px;
  --radius-sm: 8px;
  --sidebar-w: 260px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select, textarea { font-family: inherit; font-size: inherit; }

/* ========== APP SHELL ========== */
.app-shell {
  display: flex;
  min-height: 100vh;
}

/* ========== SIDEBAR ========== */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: linear-gradient(180deg, #0f1120 0%, #14172b 100%);
  color: var(--text-on-dark);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  transition: width .25s ease, transform .25s ease;
}

.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 3px; }

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 18px 16px;
}

.brand-logo {
  width: 38px; height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent-pink) 100%);
  display: grid; place-items: center;
  color: white;
  font-size: 18px;
  box-shadow: 0 4px 16px rgba(99,102,241,0.4);
}

.brand-text h1 {
  font-size: 16px;
  font-weight: 700;
  margin: 0;
  color: #fff;
  letter-spacing: -0.2px;
}
.brand-text span {
  font-size: 11px;
  color: var(--text-on-dark-muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.sidebar-collapse {
  margin-left: auto;
  color: var(--text-on-dark-muted);
  padding: 6px;
  border-radius: 6px;
  display: none;
}
.sidebar-collapse:hover { background: var(--bg-sidebar-hover); }

.btn-upload-primary {
  margin: 4px 14px 16px;
  padding: 11px 14px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  font-weight: 600;
  font-size: 13.5px;
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
  box-shadow: 0 6px 20px rgba(99,102,241,0.35);
  transition: transform .15s, box-shadow .15s;
}
.btn-upload-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(99,102,241,0.5);
}

.sidebar-nav {
  padding: 6px 10px;
  flex: 1;
}

.nav-section-title {
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-on-dark-muted);
  margin: 14px 10px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 13.5px;
  color: var(--text-on-dark);
  margin-bottom: 2px;
  transition: background .15s, color .15s;
  position: relative;
}
.nav-item i:first-child {
  width: 18px;
  text-align: center;
  color: var(--text-on-dark-muted);
  font-size: 14px;
}
.nav-item:hover {
  background: var(--bg-sidebar-hover);
}
.nav-item.active {
  background: var(--bg-sidebar-active);
  color: #fff;
  font-weight: 600;
}
.nav-item.active i:first-child {
  color: var(--primary);
}
.nav-item.active::before {
  content: '';
  position: absolute;
  left: -10px;
  top: 8px; bottom: 8px;
  width: 3px;
  background: var(--primary);
  border-radius: 0 2px 2px 0;
}
.nav-badge {
  margin-left: auto;
  background: rgba(255,255,255,0.08);
  color: var(--text-on-dark-muted);
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 500;
}
.nav-item-muted { color: var(--text-on-dark-muted); font-size: 12.5px; }
.nav-item-muted:hover { color: #fff; }

.sidebar-folders .folder-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; border-radius: 8px;
  font-size: 13px; color: var(--text-on-dark);
  margin-bottom: 2px; cursor: pointer;
  transition: background .15s;
}
.sidebar-folders .folder-item:hover { background: var(--bg-sidebar-hover); }
.sidebar-folders .folder-item.active { background: var(--bg-sidebar-active); color: #fff; font-weight: 600; }
.folder-dot {
  width: 8px; height: 8px; border-radius: 50%;
  flex-shrink: 0;
}
.folder-count {
  margin-left: auto;
  font-size: 11px;
  color: var(--text-on-dark-muted);
}

.sidebar-storage {
  padding: 16px 18px;
  border-top: 1px solid rgba(255,255,255,0.06);
  margin-top: auto;
}
.storage-label {
  display: flex; justify-content: space-between;
  font-size: 12px; color: var(--text-on-dark-muted); margin-bottom: 6px;
}
.storage-label strong { color: #fff; font-weight: 600; }
.storage-bar {
  height: 6px; background: rgba(255,255,255,0.08);
  border-radius: 3px; overflow: hidden; margin-bottom: 12px;
}
.storage-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent-pink));
  border-radius: 3px;
}
.btn-upgrade {
  width: 100%;
  padding: 8px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.12);
  color: #fff;
  font-size: 12.5px;
  font-weight: 500;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: background .15s;
}
.btn-upgrade:hover { background: var(--bg-sidebar-hover); }

/* ========== MAIN ========== */
.main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

/* ========== TOPBAR ========== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 24px;
  background: rgba(255,255,255,0.92);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--border);
}

.topbar-menu-btn { display: none; }

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
  flex-shrink: 0;
}
.breadcrumb-current { color: var(--text); font-weight: 600; }
.breadcrumb-sep { color: var(--text-soft); }

.topbar-search {
  flex: 1;
  max-width: 560px;
  margin: 0 auto;
  position: relative;
  display: flex;
  align-items: center;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0 12px;
  height: 40px;
  transition: border-color .15s, box-shadow .15s;
}
.topbar-search:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
  background: #fff;
}
.topbar-search i { color: var(--text-soft); }
.topbar-search input {
  flex: 1;
  border: none; background: transparent; outline: none;
  padding: 0 10px;
  font-size: 13.5px;
}
.topbar-search kbd {
  font-family: inherit;
  font-size: 11px;
  padding: 2px 6px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-muted);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.icon-btn {
  width: 38px; height: 38px;
  border-radius: 9px;
  display: grid; place-items: center;
  color: var(--text-muted);
  position: relative;
  transition: background .15s, color .15s;
}
.icon-btn:hover { background: var(--bg); color: var(--text); }
.notif-dot {
  position: absolute;
  top: 9px; right: 11px;
  width: 8px; height: 8px;
  background: var(--accent-red);
  border: 2px solid #fff;
  border-radius: 50%;
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 10px 4px 4px;
  border-radius: 10px;
  cursor: pointer;
  transition: background .15s;
}
.topbar-user:hover { background: var(--bg); }
.user-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  display: grid; place-items: center;
  color: #fff;
  font-weight: 600;
  font-size: 12px;
  flex-shrink: 0;
}
.user-info { display: flex; flex-direction: column; line-height: 1.2; }
.user-info strong { font-size: 13px; font-weight: 600; }
.user-info span { font-size: 11px; color: var(--text-muted); }
.topbar-user > i { font-size: 10px; color: var(--text-soft); }

/* ========== VIEW CONTAINER ========== */
.view-container {
  flex: 1;
  padding: 28px 32px 60px;
  max-width: 1600px;
  width: 100%;
  margin: 0 auto;
}

.view { display: none; animation: fadeIn .3s ease; }
.view.active { display: block; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.view-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.view-title {
  font-size: 24px;
  font-weight: 700;
  margin: 0 0 4px;
  letter-spacing: -0.3px;
}
.view-subtitle {
  margin: 0;
  color: var(--text-muted);
  font-size: 14px;
}

.view-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* ========== BUTTONS ========== */
.btn-primary, .btn-secondary, .btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: 9px;
  font-size: 13.5px;
  font-weight: 600;
  transition: all .15s;
  white-space: nowrap;
}
.btn-primary {
  background: var(--primary);
  color: white;
  box-shadow: 0 4px 12px rgba(99,102,241,0.3);
}
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); }

.btn-secondary {
  background: #fff;
  color: var(--text);
  border: 1px solid var(--border-strong);
}
.btn-secondary:hover { background: var(--bg); border-color: var(--text-muted); }

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  padding: 7px 12px;
}
.btn-ghost:hover { background: var(--bg); color: var(--text); }
.btn-ghost.danger:hover { background: rgba(239,68,68,0.08); color: var(--accent-red); }
.btn-ghost.btn-xs { font-size: 12px; padding: 5px 10px; }
.btn-ghost.btn-block { width: 100%; justify-content: center; margin-top: 12px; }
.btn-sm { padding: 6px 12px; font-size: 12.5px; }

/* ========== CHIPS ========== */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 20px;
  font-size: 12.5px;
  font-weight: 500;
  background: #fff;
  color: var(--text-muted);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
}
.chip:hover { border-color: var(--text-muted); color: var(--text); }
.chip.chip-active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* ========== KPI CARDS ========== */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.kpi-card {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 20px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  transition: transform .15s, box-shadow .15s;
}
.kpi-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }

.kpi-icon {
  width: 42px; height: 42px;
  border-radius: 11px;
  display: grid; place-items: center;
  font-size: 18px;
  margin-bottom: 14px;
}
.kpi-indigo .kpi-icon { background: #eef2ff; color: var(--primary); }
.kpi-pink .kpi-icon { background: #fdf2f8; color: var(--accent-pink); }
.kpi-emerald .kpi-icon { background: #ecfdf5; color: var(--accent-emerald); }
.kpi-amber .kpi-icon { background: #fffbeb; color: var(--accent-amber); }

.kpi-value {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-bottom: 2px;
}
.kpi-label {
  color: var(--text-muted);
  font-size: 13px;
  margin-bottom: 10px;
}
.kpi-trend {
  font-size: 12px;
  font-weight: 500;
  display: flex; align-items: center; gap: 4px;
}
.kpi-trend.up { color: var(--accent-emerald); }

/* ========== PANELS & DASHBOARD ========== */
.panel {
  background: #fff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  padding: 20px;
  margin-bottom: 20px;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  gap: 12px;
  flex-wrap: wrap;
}
.panel-header h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
}
.link-all {
  color: var(--primary);
  font-size: 12.5px;
  font-weight: 500;
}
.link-all:hover { text-decoration: underline; }

.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 0;
}
.dashboard-grid-2 {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 20px;
}
@media (max-width: 960px) {
  .dashboard-grid, .dashboard-grid-2 { grid-template-columns: 1fr; }
}

.chart-wrap { position: relative; }

/* ========== RECENT LIST ========== */
.recent-list { display: flex; flex-direction: column; gap: 10px; }
.recent-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px;
  border-radius: 10px;
  cursor: pointer;
  transition: background .15s;
}
.recent-item:hover { background: var(--bg); }
.recent-thumb {
  width: 44px; height: 44px;
  border-radius: 8px;
  background: var(--bg);
  display: grid; place-items: center;
  overflow: hidden;
  flex-shrink: 0;
}
.recent-thumb img { width: 100%; height: 100%; object-fit: cover; }
.recent-thumb i { font-size: 18px; color: var(--text-muted); }
.recent-info { flex: 1; min-width: 0; }
.recent-info .rn { font-weight: 600; font-size: 13px; margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recent-info .rm { font-size: 12px; color: var(--text-muted); }
.recent-meta { font-size: 11px; color: var(--text-soft); }

/* ========== ACTIVITY FEED ========== */
.activity-feed {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.activity-item {
  display: flex;
  gap: 12px;
  padding: 8px;
  border-radius: 8px;
  transition: background .15s;
}
.activity-item:hover { background: var(--bg); }
.activity-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  color: #fff; font-weight: 600; font-size: 11px;
  display: grid; place-items: center;
  flex-shrink: 0;
}
.activity-body { flex: 1; font-size: 13px; line-height: 1.5; }
.activity-body strong { font-weight: 600; }
.activity-body .act-target {
  font-weight: 600;
  color: var(--primary);
}
.activity-time {
  font-size: 11.5px;
  color: var(--text-soft);
  margin-top: 2px;
}
.activity-icon {
  width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 11px;
  flex-shrink: 0;
}
.ai-upload { background: #eef2ff; color: var(--primary); }
.ai-share { background: #ecfdf5; color: var(--accent-emerald); }
.ai-edit { background: #fffbeb; color: var(--accent-amber); }
.ai-download { background: #f0f9ff; color: var(--accent-blue); }
.ai-comment { background: #fdf2f8; color: var(--accent-pink); }
.ai-version { background: #f5f3ff; color: var(--accent-violet); }
.ai-delete { background: #fef2f2; color: var(--accent-red); }

.activity-feed-large .activity-item { padding: 14px 12px; border-bottom: 1px solid var(--border); border-radius: 0; }
.activity-feed-large .activity-item:last-child { border-bottom: 0; }

/* ========== FILTER BAR ========== */
.filter-bar {
  background: #fff;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 12px;
  margin-bottom: 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.filter-right {
  display: flex;
  gap: 8px;
  align-items: center;
}
.select-control {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
  outline: none;
}
.select-control:focus { border-color: var(--primary); }

/* ========== SELECTION BAR ========== */
.selection-bar {
  background: var(--primary-soft);
  border: 1px solid var(--primary);
  border-radius: var(--radius);
  padding: 10px 14px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  animation: fadeIn .2s ease;
}
.sel-actions { display: flex; gap: 4px; }

/* ========== ASSET GRID ========== */
.asset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 18px;
}

.asset-card {
  background: #fff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  overflow: hidden;
  cursor: pointer;
  transition: transform .2s, box-shadow .2s, border-color .2s;
  position: relative;
  display: flex;
  flex-direction: column;
}
.asset-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary);
}
.asset-card.selected {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary);
}

.asset-thumb {
  aspect-ratio: 4/3;
  background: var(--bg);
  position: relative;
  overflow: hidden;
  display: grid;
  place-items: center;
}
.asset-thumb img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .4s ease;
}
.asset-card:hover .asset-thumb img { transform: scale(1.05); }

.asset-thumb.generic {
  background: linear-gradient(135deg, var(--bg) 0%, #eef2ff 100%);
}
.asset-thumb.generic i {
  font-size: 54px;
  color: var(--primary);
  opacity: 0.45;
}

.asset-thumb .type-badge {
  position: absolute;
  top: 10px; left: 10px;
  background: rgba(15,23,42,0.75);
  color: white;
  font-size: 10.5px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  backdrop-filter: blur(8px);
}

.asset-thumb .star-badge {
  position: absolute;
  top: 10px; right: 10px;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: rgba(255,255,255,0.95);
  display: grid; place-items: center;
  color: var(--text-muted);
  font-size: 12px;
  opacity: 0;
  transform: scale(0.9);
  transition: opacity .15s, transform .15s, color .15s;
  z-index: 2;
}
.asset-card:hover .star-badge { opacity: 1; transform: scale(1); }
.star-badge.starred { opacity: 1; color: var(--accent-amber); }
.star-badge:hover { color: var(--accent-amber); }

.asset-thumb .status-tag {
  position: absolute;
  bottom: 10px; left: 10px;
  font-size: 10.5px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
  text-transform: capitalize;
}
.status-tag.approved { background: rgba(16,185,129,0.9); color: #fff; }
.status-tag.pending { background: rgba(245,158,11,0.9); color: #fff; }
.status-tag.draft { background: rgba(100,116,139,0.9); color: #fff; }
.status-tag.archived { background: rgba(239,68,68,0.9); color: #fff; }

.asset-thumb .shared-badge {
  position: absolute;
  bottom: 10px; right: 10px;
  background: rgba(99,102,241,0.9);
  color: #fff;
  font-size: 10px;
  padding: 3px 7px;
  border-radius: 4px;
  display: flex; align-items: center; gap: 4px;
}

.asset-body {
  padding: 12px 14px 14px;
}
.asset-name {
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}
.asset-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11.5px;
  color: var(--text-muted);
}
.asset-meta .dot-sep { color: var(--text-soft); margin: 0 6px; }

.asset-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 8px;
}
.mini-tag {
  font-size: 10.5px;
  padding: 2px 7px;
  border-radius: 4px;
  background: var(--bg);
  color: var(--text-muted);
  font-weight: 500;
}
.mini-tag.ai-tag {
  background: #f5f3ff;
  color: var(--accent-violet);
}
.mini-tag.ai-tag::before {
  content: '✨ ';
  font-size: 9px;
}

/* List mode */
.asset-grid.list-mode {
  grid-template-columns: 1fr;
  gap: 6px;
}
.asset-grid.list-mode .asset-card {
  flex-direction: row;
  align-items: center;
  padding: 8px 14px 8px 8px;
  gap: 14px;
}
.asset-grid.list-mode .asset-thumb {
  width: 54px;
  height: 54px;
  aspect-ratio: 1;
  border-radius: 8px;
  flex-shrink: 0;
}
.asset-grid.list-mode .asset-thumb.generic i { font-size: 22px; }
.asset-grid.list-mode .asset-thumb .type-badge,
.asset-grid.list-mode .asset-thumb .status-tag,
.asset-grid.list-mode .asset-thumb .shared-badge { display: none; }
.asset-grid.list-mode .asset-body { padding: 0; flex: 1; display: flex; align-items: center; gap: 16px; }
.asset-grid.list-mode .asset-name { flex: 1; margin: 0; }
.asset-grid.list-mode .asset-tags { margin: 0; }
.asset-grid.list-mode .asset-meta { min-width: 140px; justify-content: flex-end; }

/* ========== EMPTY STATE ========== */
.empty-state {
  text-align: center;
  padding: 80px 20px;
  color: var(--text-muted);
}
.empty-state i {
  font-size: 64px;
  color: var(--text-soft);
  margin-bottom: 16px;
  opacity: 0.4;
}
.empty-state h3 { margin: 0 0 6px; color: var(--text); font-size: 17px; }
.empty-state p { margin: 0; }

.empty-panel {
  text-align: center;
  padding: 60px 20px;
}
.empty-panel i { font-size: 42px; color: var(--text-soft); margin-bottom: 12px; display: block; }
.empty-panel h3 { margin: 0 0 6px; }
.empty-panel p { color: var(--text-muted); margin: 0; }

/* ========== VIEW TOGGLE ========== */
.view-toggle {
  display: flex;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 2px;
}
.vt-btn {
  width: 34px; height: 32px;
  border-radius: 7px;
  color: var(--text-muted);
  display: grid; place-items: center;
  transition: background .15s, color .15s;
}
.vt-btn.active { background: var(--primary-soft); color: var(--primary); }

/* ========== DATA TABLE ========== */
.data-table {
  width: 100%;
  border-collapse: collapse;
}
.data-table th {
  text-align: left;
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}
.data-table td {
  padding: 14px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 13.5px;
}
.data-table tr:last-child td { border-bottom: 0; }
.data-table tr:hover td { background: var(--bg); }

.user-cell {
  display: flex; align-items: center; gap: 10px;
}
.user-cell .user-avatar { width: 36px; height: 36px; font-size: 12.5px; }
.user-cell-info strong { display: block; font-weight: 600; }
.user-cell-info span { font-size: 12px; color: var(--text-muted); }

.role-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
}
.role-admin { background: #fef2f2; color: var(--accent-red); }
.role-editor { background: #eef2ff; color: var(--primary); }
.role-contributor { background: #fffbeb; color: var(--accent-amber); }
.role-viewer { background: var(--bg); color: var(--text-muted); }
.role-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 8px; }
.role-dot.role-admin { background: var(--accent-red); }
.role-dot.role-editor { background: var(--primary); }
.role-dot.role-contributor { background: var(--accent-amber); }
.role-dot.role-viewer { background: var(--text-soft); }

.role-legend {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px;
  padding-bottom: 18px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-muted);
}
.role-legend strong { color: var(--text); font-weight: 600; }

/* ========== MODAL ========== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15,17,32,0.55);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
  animation: fadeIn .2s ease;
}
.modal-overlay.open { display: flex; }

.modal {
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modalIn .25s cubic-bezier(.2,.8,.3,1.2);
}
@keyframes modalIn {
  from { transform: translateY(20px) scale(0.96); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}

.modal-sm { width: 100%; max-width: 440px; }
.modal-md { width: 100%; max-width: 620px; }
.modal-xl { width: 100%; max-width: 1180px; }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
}
.modal-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
}
.modal-header h3 i { color: var(--primary); }

.modal-body {
  padding: 22px;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 14px 22px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* ========== UPLOAD MODAL ========== */
.upload-dropzone {
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius);
  padding: 36px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color .2s, background .2s;
  margin-bottom: 18px;
}
.upload-dropzone:hover, .upload-dropzone.dragover {
  border-color: var(--primary);
  background: var(--primary-soft);
}
.upload-icon {
  font-size: 36px;
  color: var(--primary);
  margin-bottom: 10px;
}
.upload-dropzone h4 { margin: 0 0 4px; font-size: 15px; }
.upload-dropzone p { margin: 0 0 8px; color: var(--text-muted); font-size: 13px; }
.upload-dropzone .link { color: var(--primary); font-weight: 600; }
.upload-accept {
  font-size: 11.5px;
  color: var(--text-soft);
  margin-top: 6px;
}

.upload-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.upload-option-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.upload-option-row label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}
.upload-option-row.checkbox-row { justify-content: flex-start; }

.upload-queue {
  margin-top: 18px;
  padding: 14px;
  background: var(--bg);
  border-radius: var(--radius);
}
.upload-queue h4 { margin: 0 0 10px; font-size: 13px; }
.queue-item {
  display: flex; align-items: center; gap: 12px;
  background: #fff; padding: 10px; border-radius: 8px;
}
.queue-item > i { color: var(--primary); font-size: 18px; }
.queue-info { flex: 1; }
.queue-name { font-size: 13px; font-weight: 500; margin-bottom: 4px; }
.progress {
  height: 6px; background: var(--bg); border-radius: 3px; overflow: hidden;
}
.progress-fill {
  height: 100%; width: 0;
  background: linear-gradient(90deg, var(--primary), var(--accent-pink));
  transition: width .2s;
}
.queue-pct { font-size: 12px; font-weight: 600; color: var(--primary); min-width: 40px; text-align: right; }

/* ========== CHECKBOX ========== */
.check {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text);
}
.check input { display: none; }
.check-mark {
  width: 18px; height: 18px;
  border: 2px solid var(--border-strong);
  border-radius: 5px;
  display: grid; place-items: center;
  flex-shrink: 0;
  transition: background .15s, border-color .15s;
}
.check input:checked + .check-mark {
  background: var(--primary);
  border-color: var(--primary);
}
.check input:checked + .check-mark::after {
  content: '\f00c';
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  color: #fff;
  font-size: 10px;
}

/* ========== PREVIEW MODAL ========== */
.preview-header { padding: 14px 20px; }
.preview-title-wrap {
  display: flex; align-items: center; gap: 14px;
}
.preview-title-wrap > i {
  font-size: 22px; color: var(--primary);
  width: 42px; height: 42px;
  background: var(--primary-soft);
  border-radius: 10px;
  display: grid; place-items: center;
}
.preview-title-wrap h3 { margin: 0; font-size: 15px; }
.preview-title-wrap small { color: var(--text-muted); font-size: 12px; }
.preview-header-actions { display: flex; gap: 4px; }

.preview-body {
  padding: 0;
  display: flex;
  min-height: 560px;
  max-height: calc(90vh - 75px);
}
.preview-stage {
  flex: 1;
  background: #111827;
  display: grid;
  place-items: center;
  overflow: hidden;
  position: relative;
}
.preview-stage img {
  max-width: 100%; max-height: 100%;
  object-fit: contain;
}
.preview-stage .generic-preview {
  color: #fff;
  text-align: center;
  padding: 40px;
}
.preview-stage .generic-preview i {
  font-size: 96px;
  color: var(--primary);
  opacity: 0.75;
  margin-bottom: 20px;
}
.preview-stage .generic-preview h4 {
  margin: 0 0 6px; font-size: 18px;
}
.preview-stage .generic-preview p {
  margin: 0; color: rgba(255,255,255,0.6); font-size: 13px;
}
.preview-stage video { max-width: 100%; max-height: 100%; }

/* audio wave mock */
.audio-visual {
  display: flex; align-items: center; gap: 4px;
  justify-content: center; margin-top: 24px;
}
.audio-visual .bar {
  width: 4px;
  background: var(--primary);
  border-radius: 2px;
  animation: wave 1.2s ease-in-out infinite;
}
@keyframes wave {
  0%, 100% { height: 12px; }
  50% { height: 48px; }
}

.preview-side {
  width: 340px;
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  background: #fff;
  overflow-y: auto;
}

.tab-bar {
  display: flex;
  border-bottom: 1px solid var(--border);
  padding: 0 8px;
  position: sticky; top: 0;
  background: #fff;
  z-index: 2;
}
.tab-btn {
  padding: 12px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  transition: color .15s, border-color .15s;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active {
  color: var(--primary);
  border-color: var(--primary);
  font-weight: 600;
}
.tab-panel { display: none; padding: 18px; }
.tab-panel.active { display: block; }

.detail-block { margin-bottom: 20px; }
.detail-block h5 {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-muted);
  margin: 0 0 8px;
}
.detail-block h5 i { color: var(--accent-violet); margin-right: 4px; }
.detail-block p {
  margin: 0;
  font-size: 13px;
  line-height: 1.6;
}
.detail-block .editable {
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid transparent;
  transition: border-color .15s, background .15s;
}
.detail-block .editable:hover { border-color: var(--border); }
.detail-block .editable:focus { outline: none; border-color: var(--primary); background: var(--bg); }

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.tag-pill {
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 12px;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.tag-pill .rm { cursor: pointer; opacity: 0.6; font-size: 10px; }
.tag-pill .rm:hover { opacity: 1; }
.tag-list-ai .tag-pill {
  background: #f5f3ff;
  color: var(--accent-violet);
}
.tag-list-ai .tag-pill::before {
  content: '✨';
  font-size: 10px;
}
.ai-block {
  background: linear-gradient(135deg, #faf5ff 0%, #eef2ff 100%);
  padding: 14px;
  border-radius: 10px;
  border: 1px solid #e9d5ff;
}

.color-palette {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.color-swatch {
  width: 40px; height: 40px;
  border-radius: 8px;
  border: 1px solid var(--border);
  position: relative;
  cursor: pointer;
}
.color-swatch::after {
  content: attr(data-color);
  position: absolute;
  top: 100%; left: 50%;
  transform: translateX(-50%);
  margin-top: 4px;
  font-size: 10px;
  color: var(--text-muted);
  white-space: nowrap;
}

.prop-list {
  margin: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 14px;
  font-size: 12.5px;
}
.prop-list dt {
  color: var(--text-muted);
  text-transform: uppercase;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.4px;
  margin-bottom: 2px;
}
.prop-list dd {
  margin: 0;
  font-weight: 500;
  color: var(--text);
}

/* ========== VERSION LIST ========== */
.version-list { display: flex; flex-direction: column; gap: 6px; }
.version-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.version-item:hover { border-color: var(--primary); background: var(--primary-soft); }
.version-item.current { border-color: var(--primary); background: var(--primary-soft); }
.version-dot {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary);
  display: grid; place-items: center;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}
.version-info { flex: 1; font-size: 13px; }
.version-info strong { display: block; }
.version-info span { color: var(--text-muted); font-size: 11.5px; }
.version-pill {
  font-size: 10px;
  padding: 2px 8px;
  background: var(--primary);
  color: #fff;
  border-radius: 10px;
  font-weight: 600;
}

/* ========== SHARE MODAL ========== */
.share-row { margin-bottom: 18px; }
.share-row label {
  display: block;
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.share-link-box {
  display: flex;
  gap: 8px;
  align-items: center;
}
.share-link-box input {
  flex: 1;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 12.5px;
  background: var(--bg);
  color: var(--text);
  outline: none;
}
.share-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  background: var(--bg);
  border-radius: 10px;
  margin-bottom: 18px;
}
.share-invite {
  display: flex;
  gap: 6px;
}
.share-invite input {
  flex: 1;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  outline: none;
}
.share-invite input:focus { border-color: var(--primary); }

/* ========== AI SEARCH MODAL ========== */
.ai-modal .modal-header h3 i { color: var(--accent-violet); }
.ai-hint {
  color: var(--text-muted);
  font-size: 13px;
  margin: 0 0 14px;
}
.ai-search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 6px 6px 14px;
  border: 2px solid var(--accent-violet);
  border-radius: 12px;
  background: linear-gradient(135deg, #faf5ff, #eef2ff);
  margin-bottom: 14px;
}
.ai-search-box > i { color: var(--accent-violet); }
.ai-search-box input {
  flex: 1;
  border: none;
  background: transparent;
  padding: 10px 8px;
  font-size: 14px;
  outline: none;
}
.ai-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.ai-results {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
  max-height: 340px;
  overflow-y: auto;
}
.ai-result {
  background: var(--bg);
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  transition: transform .15s;
}
.ai-result:hover { transform: translateY(-2px); }
.ai-result .ar-thumb {
  aspect-ratio: 1;
  background: var(--bg);
  display: grid; place-items: center;
  overflow: hidden;
}
.ai-result .ar-thumb img { width: 100%; height: 100%; object-fit: cover; }
.ai-result .ar-thumb i { font-size: 28px; color: var(--primary); opacity: 0.5; }
.ai-result .ar-name {
  padding: 6px 8px;
  font-size: 11.5px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ai-score {
  background: var(--accent-violet);
  color: #fff;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 3px;
  margin-left: 4px;
  font-weight: 600;
}

/* ========== TOAST ========== */
.toast-wrap {
  position: fixed;
  bottom: 24px; right: 24px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast {
  background: #0f1120;
  color: #fff;
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow-lg);
  min-width: 260px;
  animation: toastIn .25s ease;
}
.toast.success { background: var(--accent-emerald); }
.toast.error { background: var(--accent-red); }
.toast.info { background: var(--primary); }
@keyframes toastIn {
  from { transform: translateX(40px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
.toast i { font-size: 16px; }

/* ========== RESPONSIVE ========== */
@media (max-width: 900px) {
  .sidebar {
    position: fixed;
    z-index: 50;
    transform: translateX(-100%);
  }
  .sidebar.open { transform: translateX(0); }
  .topbar-menu-btn { display: grid; place-items: center; }
  .topbar-search kbd { display: none; }
  .topbar-search { max-width: none; }
  .user-info { display: none; }
  .view-container { padding: 20px 16px 40px; }
  .preview-body { flex-direction: column; }
  .preview-side { width: 100%; border-left: 0; border-top: 1px solid var(--border); max-height: 360px; }
  .preview-stage { min-height: 280px; }
  .breadcrumb { display: none; }
}

@media (max-width: 540px) {
  .view-title { font-size: 20px; }
  .view-header-actions { width: 100%; }
  .asset-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
  .filter-bar { padding: 10px; }
  .filter-right { width: 100%; }
  .filter-right .select-control { flex: 1; }
}
