/* ============================================================
   SPAZJU — Design System v2
   Philosophy: Clean, neutral dark. Supabase-inspired.
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Syne:wght@700;800&display=swap');

:root {
  /* Palette — neutral dark, Supabase-inspired */
  --bg:          #171717;
  --bg-raised:   #1c1c1c;
  --bg-card:     #212121;
  --bg-hover:    #262626;
  --bg-input:    #1c1c1c;
  --surface:     #2a2a2a;

  /* Borders */
  --line:        rgba(255,255,255,0.06);
  --line-hover:  rgba(255,255,255,0.12);

  /* Text */
  --t1: #ededed;
  --t2: #8f8f8f;
  --t3: #525252;

  /* Accent — emerald green */
  --accent:      #3ecf8e;
  --accent-dim:  rgba(62,207,142,0.08);
  --accent-glow: rgba(62,207,142,0.15);

  /* Status */
  --green:  #3ecf8e;
  --green-dim: rgba(62,207,142,0.1);
  --red:    #f06060;
  --red-dim: rgba(240,96,96,0.1);
  --blue:   #6e8efb;
  --blue-dim: rgba(110,142,251,0.1);

  /* Geometry */
  --r-sm: 4px;
  --r-md: 8px;
  --r-lg: 12px;
  --r-full: 9999px;
  --sidebar: 240px;
  --ease: cubic-bezier(0.22,1,0.36,1);
}

/* RESET */
*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }
html { -webkit-font-smoothing:antialiased; -moz-osx-font-smoothing:grayscale; }
body {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--t1);
  background: var(--bg);
  min-height: 100vh;
}
a { color:inherit; text-decoration:none; }
img, video { display:block; max-width:100%; }
button { font-family:inherit; }
::-webkit-scrollbar { width:5px; }
::-webkit-scrollbar-track { background:transparent; }
::-webkit-scrollbar-thumb { background:var(--line-hover); border-radius:99px; }

/* TYPOGRAPHY */
.heading-display {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
}
h1,h2,h3,h4 { font-weight:600; line-height:1.25; letter-spacing:-0.018em; }
h1 { font-size:1.4rem; }
h2 { font-size:1.15rem; }
h3 { font-size:1rem; }
p { color:var(--t2); }

/* ========================
   AUTH PAGE
======================== */
.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 2rem;
  background: var(--bg);
  /* Subtle grid texture */
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 48px 48px;
}

.auth-card {
  width: 100%;
  max-width: 400px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 2.5rem 2.25rem;
  position: relative;
}

/* Top accent bar */
.auth-card::before {
  content: '';
  position: absolute;
  top: 0; left: 2rem; right: 2rem;
  height: 2px;
  background: var(--accent);
  border-radius: 0 0 2px 2px;
}

.auth-brand {
  margin-bottom: 2.25rem;
}
.auth-brand-icon {
  width: 40px; height: 40px;
  background: var(--accent-dim);
  border: 1px solid var(--accent-glow);
  border-radius: var(--r-md);
  display: flex; align-items:center; justify-content:center;
  color: var(--accent);
  margin-bottom: 1.25rem;
}
.auth-brand h1 {
  font-family: 'Syne', sans-serif;
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--t1);
}
.auth-brand p { font-size:0.75rem; margin-top:0.25rem; color:var(--t3); letter-spacing:0.04em; text-transform:uppercase; }

.auth-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--line);
  margin-bottom: 1.75rem;
}
.auth-tab {
  flex: 1;
  padding: 0.625rem;
  text-align: center;
  background: transparent;
  border: none;
  color: var(--t3);
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 150ms, border-color 150ms;
}
.auth-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.auth-tab:hover:not(.active) { color: var(--t2); }

.auth-form { display:flex; flex-direction:column; gap:1rem; }
.auth-error {
  min-height: 1.25rem;
  font-size: 0.75rem;
  color: var(--red);
  text-align: center;
  margin-bottom: 0.25rem;
}
.auth-footer {
  margin-top: 1.5rem;
  text-align: center;
  font-size: 0.6875rem;
  color: var(--t3);
  letter-spacing: 0.03em;
}

/* ========================
   APP SHELL
======================== */
.app-layout { display:flex; min-height:100vh; }
.main-content {
  flex: 1;
  margin-left: var(--sidebar);
  padding: 2.25rem 2.5rem;
  max-width: calc(100vw - var(--sidebar));
}

/* ========================
   SIDEBAR
======================== */
.sidebar {
  width: var(--sidebar);
  background: var(--bg-raised);
  border-right: 1px solid var(--line);
  position: fixed; top:0; left:0; bottom:0;
  display: flex; flex-direction:column;
  z-index: 100;
}

.sidebar-brand {
  padding: 1.5rem 1.25rem 1.25rem;
  border-bottom: 1px solid var(--line);
  display: flex; align-items:center; gap:0.625rem;
}
.sidebar-brand-icon {
  width:30px; height:30px;
  background: var(--accent-dim);
  border: 1px solid var(--accent-glow);
  border-radius: var(--r-sm);
  display:flex; align-items:center; justify-content:center;
  color:var(--accent);
}
.sidebar-brand span {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 1rem;
  letter-spacing: 0.08em;
  color: var(--t1);
}

.sidebar-section-label {
  padding: 1.25rem 1.25rem 0.4rem;
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--t3);
}

.sidebar-nav {
  flex:1;
  padding: 0.5rem 0.625rem;
  display:flex; flex-direction:column; gap:2px;
}
.sidebar-nav a {
  display:flex; align-items:center; gap:0.625rem;
  padding: 0.5rem 0.625rem;
  border-radius: var(--r-sm);
  color: var(--t2);
  font-size: 0.8125rem;
  font-weight: 450;
  transition: all 120ms;
  text-decoration: none;
}
.sidebar-nav a svg, .sidebar-nav a i { width:16px; height:16px; flex-shrink:0; opacity:0.7; }
.sidebar-nav a:hover { color:var(--t1); background:var(--bg-hover); }
.sidebar-nav a.active {
  color: var(--accent);
  background: var(--accent-dim);
  font-weight: 500;
}
.sidebar-nav a.active svg, .sidebar-nav a.active i { opacity:1; }

.sidebar-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--line);
  display:flex; align-items:center; gap:0.625rem;
}
.sidebar-avatar {
  width:28px; height:28px;
  background: var(--surface);
  border: 1px solid var(--line-hover);
  border-radius: 50%;
  display:flex; align-items:center; justify-content:center;
  font-size:0.6875rem; font-weight:600; color:var(--t2);
  flex-shrink:0;
}
.sidebar-email {
  flex:1; font-size:0.6875rem; color:var(--t3);
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.sidebar-signout {
  width:26px; height:26px;
  background:transparent; border:none; cursor:pointer;
  color:var(--t3); border-radius:var(--r-sm);
  display:flex; align-items:center; justify-content:center;
  transition:all 120ms; flex-shrink:0;
}
.sidebar-signout:hover { color:var(--red); background:var(--red-dim); }

/* ========================
   PAGE HEADER
======================== */
.page-header {
  display:flex; align-items:flex-start; justify-content:space-between;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--line);
}
.page-header-left h1 { font-size:1.3rem; }
.page-header-left p { font-size:0.8rem; color:var(--t3); margin-top:0.2rem; }

/* ========================
   BUTTONS
======================== */
.btn {
  display:inline-flex; align-items:center; gap:0.4rem;
  padding: 0.45rem 0.9rem;
  border: none; border-radius: var(--r-sm);
  font-family:inherit; font-size:0.8125rem; font-weight:500;
  cursor:pointer; transition:all 130ms; line-height:1.4;
  white-space:nowrap;
}
.btn i, .btn svg { width:14px; height:14px; }

.btn-primary {
  background: var(--accent);
  color: #0d0d0f;
  font-weight: 600;
}
.btn-primary:hover { background: #f0aa28; box-shadow: 0 0 20px var(--accent-glow); }

.btn-secondary {
  background: var(--surface);
  color: var(--t2);
  border: 1px solid var(--line);
}
.btn-secondary:hover { color:var(--t1); border-color:var(--line-hover); background:var(--bg-hover); }

.btn-danger {
  background: var(--red-dim);
  color: var(--red);
  border: 1px solid rgba(240,96,96,0.2);
}
.btn-danger:hover { background:rgba(240,96,96,0.18); }

.btn-ghost { background:transparent; color:var(--t2); }
.btn-ghost:hover { color:var(--t1); background:var(--bg-hover); }

.btn-sm { padding:0.3rem 0.65rem; font-size:0.75rem; }

.btn-icon {
  width:30px; height:30px; padding:0;
  display:inline-flex; align-items:center; justify-content:center;
  background:transparent; border:none; cursor:pointer;
  color:var(--t3); border-radius:var(--r-sm);
  transition:all 120ms;
}
.btn-icon:hover { color:var(--t1); background:var(--bg-hover); }
.btn-icon i, .btn-icon svg { width:14px; height:14px; }

/* ========================
   FORM ELEMENTS
======================== */
.form-group { display:flex; flex-direction:column; gap:0.375rem; }
.form-label {
  font-size:0.6875rem; font-weight:500;
  color:var(--t3); text-transform:uppercase; letter-spacing:0.06em;
}
.form-input, .form-select {
  padding: 0.55rem 0.75rem;
  background: var(--bg-input);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  color: var(--t1);
  font-family:inherit; font-size:0.8125rem;
  outline:none; transition:border-color 130ms;
  width:100%;
}
.form-input:focus, .form-select:focus { border-color:var(--accent); }
.form-input::placeholder { color:var(--t3); }
.form-select { cursor:pointer; }
.form-select option { background:var(--bg-card); }

/* ========================
   STAT CARDS
======================== */
.stats-grid {
  display:grid;
  grid-template-columns: repeat(4,1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow:hidden;
  margin-bottom: 2rem;
}
.stat-card {
  background: var(--bg-card);
  padding: 1.5rem;
  display:flex; flex-direction:column; gap:0.75rem;
  transition:background 130ms;
}
.stat-card:hover { background:var(--bg-hover); }
.stat-icon {
  width:36px; height:36px;
  border-radius: var(--r-sm);
  display:flex; align-items:center; justify-content:center;
}
.stat-icon i, .stat-icon svg { width:18px; height:18px; }
.stat-icon.blue { background:var(--blue-dim); color:var(--blue); }
.stat-icon.green { background:var(--green-dim); color:var(--green); }
.stat-icon.amber { background:var(--accent-dim); color:var(--accent); }
.stat-icon.red { background:var(--red-dim); color:var(--red); }
.stat-value { font-size:1.75rem; font-weight:700; letter-spacing:-0.03em; line-height:1; }
.stat-label { font-size:0.6875rem; color:var(--t3); text-transform:uppercase; letter-spacing:0.08em; }

/* ========================
   CARDS
======================== */
.card {
  background:var(--bg-card);
  border:1px solid var(--line);
  border-radius:var(--r-lg);
  padding:1.5rem;
}

/* ========================
   UPLOAD ZONE
======================== */
.upload-zone {
  border: 1px dashed var(--line-hover);
  border-radius: var(--r-lg);
  padding: 2.5rem;
  text-align:center;
  cursor:pointer;
  transition:all 200ms;
  margin-bottom: 1.75rem;
  background: var(--bg-raised);
}
.upload-zone:hover, .upload-zone.dragover {
  border-color:var(--accent);
  background: var(--accent-dim);
}
.upload-zone i, .upload-zone svg { color:var(--t3); margin-bottom:0.75rem; width:32px; height:32px; }
.upload-zone p { font-size:0.8125rem; color:var(--t2); }
.upload-hint { font-size:0.6875rem; color:var(--t3); margin-top:0.375rem; }
.upload-zone input[type="file"] { display:none; }

/* ========================
   ASSET GRID
======================== */
.asset-grid {
  display:grid;
  grid-template-columns:repeat(auto-fill, minmax(200px,1fr));
  gap:1px;
  background:var(--line);
  border:1px solid var(--line);
  border-radius:var(--r-lg);
  overflow:hidden;
}
.asset-card {
  background:var(--bg-card);
  transition:background 130ms;
  display:flex; flex-direction:column;
}
.asset-card:hover { background:var(--bg-hover); }
.asset-thumb {
  width:100%; aspect-ratio:16/9;
  background:var(--bg-raised);
  display:flex; align-items:center; justify-content:center;
  color:var(--t3); overflow:hidden; flex-shrink:0;
}
.asset-thumb i, .asset-thumb svg { width:28px; height:28px; }
.asset-thumb img, .asset-thumb video { width:100%; height:100%; object-fit:cover; }
.asset-info { padding:0.875rem 1rem; flex:1; }
.asset-name { font-size:0.8rem; font-weight:500; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; margin-bottom:0.375rem; }
.asset-meta { display:flex; justify-content:space-between; align-items:center; font-size:0.6875rem; color:var(--t3); }
.asset-actions {
  padding:0.5rem 0.75rem;
  border-top:1px solid var(--line);
  display:flex; gap:0.25rem;
}

/* ========================
   BADGES
======================== */
.badge {
  display:inline-flex; align-items:center; gap:0.25rem;
  padding:0.125rem 0.45rem;
  border-radius:2px;
  font-size:0.625rem; font-weight:600;
  text-transform:uppercase; letter-spacing:0.06em;
}
.badge-success { background:var(--green-dim); color:var(--green); }
.badge-danger  { background:var(--red-dim);   color:var(--red);   }
.badge-warning { background:var(--accent-dim); color:var(--accent); }
.badge-neutral { background:var(--surface);   color:var(--t2);    }

/* Status dot */
.dot {
  width:7px; height:7px;
  border-radius:50%; display:inline-block; flex-shrink:0;
}
.dot-online  { background:var(--green); box-shadow:0 0 6px rgba(62,207,142,0.5); }
.dot-offline { background:var(--t3); }

/* ========================
   DATA ROWS (Playlists / Devices)
======================== */
.data-list { display:flex; flex-direction:column; gap:1px; background:var(--line); border:1px solid var(--line); border-radius:var(--r-lg); overflow:hidden; }
.data-row {
  display:flex; align-items:center; gap:1rem;
  padding:1rem 1.25rem;
  background:var(--bg-card);
  transition:background 120ms;
}
.data-row:hover { background:var(--bg-hover); }
.data-row-icon { flex-shrink:0; color:var(--t3); }
.data-row-icon i, .data-row-icon svg { width:18px; height:18px; }
.data-row-info { flex:1; min-width:0; }
.data-row-title { font-weight:500; font-size:0.875rem; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.data-row-sub { font-size:0.6875rem; color:var(--t3); margin-top:0.125rem; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.data-row-actions { display:flex; align-items:center; gap:0.375rem; flex-shrink:0; }

/* ========================
   MODAL
======================== */
.modal-overlay {
  position:fixed; inset:0;
  background:rgba(0,0,0,0.7);
  display:flex; align-items:center; justify-content:center;
  z-index:1000; padding:2rem;
}
.modal-overlay.hidden { display:none; }
.modal {
  width:100%; max-width:480px;
  background:var(--bg-card);
  border:1px solid var(--line-hover);
  border-radius:var(--r-lg);
  padding:1.75rem;
  max-height:90vh; overflow-y:auto;
  animation: modalIn 220ms var(--ease);
}
@keyframes modalIn { from { opacity:0; transform:scale(0.97) translateY(8px); } to { opacity:1; transform:none; } }
.modal-header {
  display:flex; align-items:center; justify-content:space-between;
  margin-bottom:1.5rem; padding-bottom:1rem;
  border-bottom:1px solid var(--line);
}
.modal-header h3 { font-size:0.9375rem; }
.modal-body { display:flex; flex-direction:column; gap:1rem; }
.modal-footer { display:flex; justify-content:flex-end; gap:0.5rem; margin-top:1.5rem; padding-top:1rem; border-top:1px solid var(--line); }

/* ========================
   DEVICE PAIRING
======================== */
.device-token-display {
  background:var(--bg-raised);
  border:1px solid var(--line);
  border-radius:var(--r-md);
  padding:1.5rem;
  text-align:center;
}
.pairing-section {
  padding:0.5rem 0 1rem;
}
.pairing-label {
  font-size:0.625rem; font-weight:600;
  text-transform:uppercase; letter-spacing:0.1em;
  color:var(--t3); margin-bottom:0.75rem;
}
.pairing-code {
  font-family:'JetBrains Mono', 'SF Mono', monospace;
  font-size:2.5rem; font-weight:700;
  letter-spacing:0.2em;
  color:var(--accent);
  line-height:1;
}
.token-divider {
  display:flex; align-items:center; gap:0.75rem;
  margin:1rem 0;
}
.token-divider::before,
.token-divider::after {
  content:''; flex:1; height:1px;
  background:var(--line);
}
.token-divider span {
  font-size:0.625rem; color:var(--t3);
  text-transform:uppercase; letter-spacing:0.06em;
  white-space:nowrap;
}
.device-token-display code {
  font-family:'JetBrains Mono',monospace; font-size:0.65rem;
  color:var(--t2); word-break:break-all; display:block;
  background:var(--bg-input); padding:0.5rem; border-radius:var(--r-sm);
  border:1px solid var(--line);
}

/* ========================
   ASSET SELECT GRID (in modals)
======================== */
.select-grid {
  display:grid; grid-template-columns:1fr 1fr;
  gap:0.375rem; max-height:260px; overflow-y:auto;
}
.select-item {
  display:flex; align-items:center; gap:0.5rem;
  padding:0.45rem 0.6rem;
  background:var(--bg-raised);
  border:1px solid var(--line);
  border-radius:var(--r-sm);
  cursor:pointer; font-size:0.75rem;
  transition:all 120ms; user-select:none;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.select-item:hover { border-color:var(--line-hover); color:var(--t1); }
.select-item.selected { border-color:var(--accent); background:var(--accent-dim); color:var(--accent); }
.select-item input { display:none; }

/* ========================
   ASSET PREVIEW GRID (read-only in playlist modal)
======================== */
.asset-preview-grid {
  display:grid; grid-template-columns:repeat(auto-fill, minmax(90px,1fr));
  gap:0.5rem; max-height:260px; overflow-y:auto;
}
.asset-preview-item {
  display:flex; flex-direction:column; gap:0.25rem;
}
.asset-preview-thumb {
  width:100%; aspect-ratio:16/10;
  border-radius:var(--r-sm);
  overflow:hidden; background:var(--bg-raised);
  border:1px solid var(--line);
  display:flex; align-items:center; justify-content:center;
}
.asset-preview-thumb img,
.asset-preview-thumb video {
  width:100%; height:100%; object-fit:cover;
}
.asset-preview-thumb .preview-icon {
  color:var(--t3);
}
.asset-preview-thumb .preview-icon i,
.asset-preview-thumb .preview-icon svg { width:18px; height:18px; }
.asset-preview-name {
  font-size:0.5625rem; color:var(--t2);
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
  text-align:center;
}

/* ========================
   USER BADGES
======================== */
.user-badge {
  display:inline-block;
  font-size:0.5625rem; font-weight:600;
  text-transform:uppercase; letter-spacing:0.06em;
  padding:0.125rem 0.375rem;
  border-radius:var(--r-full);
  background:var(--bg-raised);
  border:1px solid var(--line);
  color:var(--t2);
}
.user-badge.badge-accent {
  background:var(--accent-dim);
  border-color:var(--accent-glow);
  color:var(--accent);
}

/* ========================
   SECTION
======================== */
.section { margin-bottom:2rem; }
.section-title {
  font-size:0.625rem; text-transform:uppercase;
  letter-spacing:0.1em; color:var(--t3);
  font-weight:600; margin-bottom:0.875rem;
}

/* ========================
   EMPTY STATE
======================== */
.empty-state {
  text-align:center; padding:4rem 2rem;
  border:1px solid var(--line);
  border-radius:var(--r-lg);
  background:var(--bg-raised);
}
.empty-state i, .empty-state svg { color:var(--t3); margin-bottom:0.875rem; width:36px; height:36px; }
.empty-state p { font-size:0.8125rem; color:var(--t3); margin-bottom:1.25rem; }

/* ========================
   TOAST
======================== */
.toast-container {
  position:fixed; top:1.25rem; right:1.25rem;
  z-index:2000; display:flex; flex-direction:column; gap:0.5rem;
}
.toast {
  padding:0.625rem 1rem;
  background:var(--bg-card);
  border:1px solid var(--line-hover);
  border-radius:var(--r-md);
  font-size:0.8rem; min-width:260px;
  box-shadow:0 8px 32px rgba(0,0,0,0.5);
  display:flex; align-items:center; gap:0.625rem;
  animation:toastIn 250ms var(--ease);
  transition:opacity 200ms;
}
.toast i, .toast svg { width:14px; height:14px; flex-shrink:0; }
.toast.success { border-left:3px solid var(--green); }
.toast.success i, .toast.success svg { color:var(--green); }
.toast.error   { border-left:3px solid var(--red); }
.toast.error i, .toast.error svg { color:var(--red); }
.toast.info    { border-left:3px solid var(--blue); }
.toast.info i, .toast.info svg { color:var(--blue); }
@keyframes toastIn { from { opacity:0; transform:translateX(12px); } to { opacity:1; transform:none; } }

/* ========================
   LOADING
======================== */
.loading {
  display:flex; align-items:center; justify-content:center;
  gap:0.625rem; padding:3rem; color:var(--t3); font-size:0.8125rem;
}
.spinner {
  width:16px; height:16px;
  border:2px solid var(--line); border-top-color:var(--accent);
  border-radius:50%;
  animation:spin 0.7s linear infinite;
}
@keyframes spin { to { transform:rotate(360deg); } }

/* ========================
   SEARCH
======================== */
.search-wrap { position:relative; }
.search-wrap i, .search-wrap svg {
  position:absolute; left:0.65rem; top:50%; transform:translateY(-50%);
  color:var(--t3); width:14px; height:14px; pointer-events:none;
}
.search-input {
  width:100%; padding:0.5rem 0.75rem 0.5rem 2.1rem;
  background:var(--bg-input); border:1px solid var(--line);
  border-radius:var(--r-sm); color:var(--t1);
  font-family:inherit; font-size:0.8125rem; outline:none;
  transition:border-color 130ms;
}
.search-input:focus { border-color:var(--accent); }
.search-input::placeholder { color:var(--t3); }

/* ========================
   TOOLBAR (above lists)
======================== */
.toolbar {
  display:flex; align-items:center; gap:0.75rem;
  margin-bottom:1.25rem;
}
.toolbar .search-wrap { flex:1; }

/* ========================
   CALENDAR WIDGET
======================== */
.cal { background:var(--bg-raised); border:1px solid var(--line); border-radius:var(--r-md); padding:0.75rem; }
.cal-header { display:flex; align-items:center; justify-content:space-between; margin-bottom:0.625rem; }
.cal-title { font-size:0.8125rem; font-weight:600; color:var(--t1); }
.cal-days-header { display:grid; grid-template-columns:repeat(7,1fr); gap:1px; margin-bottom:0.25rem; }
.cal-day-label { text-align:center; font-size:0.5625rem; font-weight:600; color:var(--t3); text-transform:uppercase; letter-spacing:0.05em; padding:0.25rem 0; }
.cal-grid { display:grid; grid-template-columns:repeat(7,1fr); gap:2px; }
.cal-day {
  text-align:center; padding:0.4rem 0;
  font-size:0.75rem; font-weight:450;
  border-radius:var(--r-sm); cursor:pointer;
  color:var(--t1); transition:all 100ms;
}
.cal-day:hover:not(.cal-past):not(.cal-selected):not(.cal-empty) { background:var(--bg-hover); }
.cal-day.cal-empty { cursor:default; }
.cal-day.cal-past { color:var(--t3); cursor:default; opacity:0.5; }
.cal-day.cal-today { box-shadow:inset 0 0 0 1px var(--line-hover); }
.cal-day.cal-selected { background:var(--accent); color:#0d0d0f; font-weight:600; }

/* ========================
   FILTER BAR
======================== */
.filter-bar {
  display:flex; align-items:center; gap:0.75rem;
  margin-bottom:1.5rem;
  padding:0.75rem 1rem;
  background:var(--bg-raised);
  border:1px solid var(--line);
  border-radius:var(--r-md);
}
.filter-label {
  display:flex; align-items:center; gap:0.375rem;
  font-size:0.6875rem; font-weight:500;
  color:var(--t3); text-transform:uppercase;
  letter-spacing:0.06em; white-space:nowrap;
}
.filter-bar .form-select {
  max-width:260px;
  padding:0.4rem 0.65rem;
  font-size:0.75rem;
}

/* ========================
   PLAYLIST BADGES ON ASSET CARDS
======================== */
.asset-playlists {
  display:flex; flex-wrap:wrap; gap:0.2rem;
  margin-bottom:0.375rem;
}
.badge-playlist {
  background:var(--blue-dim); color:var(--blue);
}
.badge-muted {
  background:transparent; color:var(--t3);
  border:1px dashed var(--line-hover);
}

/* ========================
   CHECKBOX LIST (in modals)
======================== */
.checkbox-list {
  display:flex; flex-direction:column; gap:0.25rem;
  max-height:280px; overflow-y:auto;
}
.checkbox-row {
  display:flex; align-items:center; gap:0.625rem;
  padding:0.5rem 0.75rem;
  background:var(--bg-raised);
  border:1px solid var(--line);
  border-radius:var(--r-sm);
  cursor:pointer; font-size:0.8rem;
  transition:all 120ms; user-select:none;
}
.checkbox-row:hover { border-color:var(--line-hover); background:var(--bg-hover); }
.checkbox-row input[type="checkbox"] {
  accent-color:var(--accent);
  width:15px; height:15px; flex-shrink:0; cursor:pointer;
}

/* ========================
   DRAG AND DROP
======================== */
.drag-hint {
  display:flex; align-items:center; gap:0.375rem;
  font-size:0.6875rem; color:var(--t3);
  margin-bottom:0.625rem;
}
.drag-handle {
  position:absolute; top:0.375rem; left:0.375rem;
  width:22px; height:22px;
  display:flex; align-items:center; justify-content:center;
  background:rgba(0,0,0,0.5); border-radius:var(--r-sm);
  color:var(--t2); cursor:grab; z-index:2;
  opacity:0; transition:opacity 150ms;
}
.drag-handle i, .drag-handle svg { width:12px; height:12px; }
.asset-card.draggable { position:relative; }
.asset-card.draggable:hover .drag-handle { opacity:1; }
.asset-card.dragging { opacity:0.4; }
.asset-card.drag-over { box-shadow:inset 0 0 0 2px var(--accent); }

/* ========================
   LIGHTBOX
======================== */
.lightbox {
  position:fixed; inset:0; z-index:3000;
  display:flex; align-items:center; justify-content:center;
  animation:fadeIn 180ms ease;
}
.lightbox-backdrop {
  position:absolute; inset:0;
  background:rgba(0,0,0,0.88);
  cursor:pointer;
}
.lightbox-content {
  position:relative; z-index:1;
  max-width:90vw; max-height:90vh;
  display:flex; flex-direction:column;
  animation:modalIn 250ms var(--ease);
}
.lightbox-header {
  display:flex; align-items:center; justify-content:space-between;
  padding:0.5rem 0; margin-bottom:0.25rem;
}
.lightbox-filename {
  font-size:0.75rem; color:var(--t2);
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.lightbox-media {
  max-width:90vw; max-height:80vh;
  border-radius:var(--r-md);
  object-fit:contain;
  background:#000;
}

/* ========================
   SITE FOOTER
======================== */
.site-footer {
  margin-top:3rem;
  padding:1.5rem 0 0.5rem;
  border-top:1px solid var(--line);
  text-align:center;
  font-size:0.625rem;
  color:var(--t3);
  letter-spacing:0.06em;
}
.site-footer--auth {
  position:fixed; bottom:0; left:0; right:0;
  margin:0; padding:1rem;
  border:none;
}

/* ========================
   ANIMATIONS
======================== */
@keyframes fadeIn { from { opacity:0; } to { opacity:1; } }
@keyframes slideUp { from { opacity:0; transform:translateY(6px); } to { opacity:1; transform:none; } }
.animate-in { animation:slideUp 250ms var(--ease); }

/* ========================
   RESPONSIVE
======================== */
@media(max-width:1100px) {
  .stats-grid { grid-template-columns:repeat(2,1fr); }
}
@media(max-width:768px) {
  :root { --sidebar:0px; }
  .sidebar { display:none; }
  .main-content { margin-left:0; max-width:100%; padding:1.25rem; }
  .stats-grid { grid-template-columns:1fr 1fr; }
}
@media(max-width:480px) {
  .stats-grid { grid-template-columns:1fr; }
  .asset-grid { grid-template-columns:1fr 1fr; }
}
