/* === MemoVault — Dark Editorial Aesthetic === */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,600;0,700;1,400&family=DM+Sans:opsz,wght@9..40,300;9..40,400;9..40,500;9..40,600&family=DM+Mono:wght@400;500&display=swap');

:root {
  --bg-base: #0e0f11;
  --bg-card: #16181c;
  --bg-sidebar: #111316;
  --bg-elevated: #1d2026;
  --bg-input: #1a1d22;
  --border: rgba(255,255,255,0.07);
  --border-strong: rgba(255,255,255,0.12);
  --text-primary: #f0ece4;
  --text-secondary: #8b8d96;
  --text-muted: #555966;
  --accent: #6366f1;
  --accent-glow: rgba(99,102,241,0.25);
  --pink: #ec4899;
  --amber: #f59e0b;
  --emerald: #10b981;
  --blue: #3b82f6;
  --red: #ef4444;
  --font-display: 'Playfair Display', Georgia, serif;
  --font-body: 'DM Sans', system-ui, sans-serif;
  --font-mono: 'DM Mono', monospace;
  --radius: 12px;
  --radius-sm: 8px;
  --sidebar-width: 260px;
  --nav-height: 60px;
  --shadow: 0 4px 24px rgba(0,0,0,0.4);
  --shadow-card: 0 2px 12px rgba(0,0,0,0.3);
  --transition: all 0.2s ease;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg-base);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  overflow-x: hidden;
}

/* ===== AUTH ===== */
.auth-screen {
  width: 100%;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--bg-base);
}

.auth-card {
  width: min(420px, 100%);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  position: relative;
}

.auth-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--pink), var(--amber));
}

.auth-brand { border-bottom: 1px solid var(--border); }

.auth-tabs {
  display: flex;
  padding: 14px 20px 0;
  gap: 8px;
}

.auth-tab {
  flex: 1;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  padding: 8px 12px;
  font-size: 13px;
  transition: var(--transition);
}

.auth-tab.active {
  background: rgba(99,102,241,0.2);
  border-color: var(--accent);
  color: #818cf8;
  font-weight: 500;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px 20px 20px;
}

.auth-submit {
  width: 100%;
  justify-content: center;
  border-radius: var(--radius-sm);
}

/* ===== SIDEBAR ===== */
.sidebar {
  width: var(--sidebar-width);
  min-height: 100vh;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  z-index: 100;
  transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
  overflow-y: auto;
  padding-bottom: 80px;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 24px 20px 20px;
  border-bottom: 1px solid var(--border);
}

.brand-icon {
  width: 38px; height: 38px;
  background: linear-gradient(135deg, var(--accent), #818cf8);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  color: white;
  box-shadow: 0 4px 14px var(--accent-glow);
  flex-shrink: 0;
}

.brand-name {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.3px;
}

.brand-sub {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1.5px;
}

.sidebar-search {
  position: relative;
  margin: 16px 16px 8px;
}

.sidebar-search input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 40px 9px 34px;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 13px;
  outline: none;
  transition: var(--transition);
}

.sidebar-search input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

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

.search-icon {
  position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
  color: var(--text-muted); font-size: 13px; pointer-events: none;
}

.search-kbd {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: 4px; padding: 1px 5px;
  font-family: var(--font-mono); font-size: 10px; color: var(--text-muted);
}

.sidebar-nav { padding: 8px 12px; flex: 1; }

.nav-label {
  font-size: 10px; text-transform: uppercase; letter-spacing: 1.5px;
  color: var(--text-muted); padding: 8px 8px 4px; font-weight: 600;
}

.collections-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-icon-btn {
  width: 22px; height: 22px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text-muted);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px;
  cursor: pointer;
  transition: var(--transition);
}

.nav-icon-btn:hover { color: var(--text-primary); border-color: var(--accent); }

.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: var(--radius-sm);
  color: var(--text-secondary); text-decoration: none;
  font-size: 13.5px; font-weight: 400;
  transition: var(--transition); cursor: pointer;
  position: relative; margin-bottom: 2px;
}

.nav-item:hover { background: var(--bg-elevated); color: var(--text-primary); }
.nav-item.active {
  background: rgba(99,102,241,0.15);
  color: #818cf8;
  font-weight: 500;
}

.nav-item i { width: 16px; text-align: center; font-size: 14px; }

.nav-badge {
  margin-left: auto; background: var(--bg-elevated);
  color: var(--text-muted); font-size: 10px; font-family: var(--font-mono);
  padding: 1px 6px; border-radius: 20px; min-width: 20px; text-align: center;
}

.nav-item.active .nav-badge { background: rgba(99,102,241,0.3); color: #818cf8; }

.sidebar-footer {
  position: fixed; bottom: 0; left: 0;
  width: var(--sidebar-width);
  padding: 12px 16px;
  background: var(--bg-sidebar);
  border-top: 1px solid var(--border);
  display: flex; gap: 8px;
  align-items: center;
}

.stat-pill {
  display: flex; align-items: center; gap: 5px;
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: 20px; padding: 4px 10px;
  font-size: 11px; color: var(--text-secondary);
  font-family: var(--font-mono);
}

.stat-pill i { font-size: 10px; color: var(--accent); }

.logout-btn {
  width: 28px; height: 28px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text-muted);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}
.logout-btn:hover { color: var(--red); border-color: var(--red); }

/* ===== MAIN CONTENT ===== */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ===== TOP NAV ===== */
.top-nav {
  height: var(--nav-height);
  background: var(--bg-base);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  padding: 0 24px; gap: 16px;
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(12px);
  background: rgba(14,15,17,0.9);
}

.sidebar-toggle {
  background: none; border: none; color: var(--text-secondary);
  font-size: 22px; cursor: pointer; display: none;
  padding: 4px; border-radius: 6px;
  transition: var(--transition);
}
.sidebar-toggle:hover { color: var(--text-primary); background: var(--bg-elevated); }

.top-nav-title {
  font-family: var(--font-display);
  font-size: 17px; font-weight: 600;
  color: var(--text-primary); flex: 1;
}

.top-nav-actions { display: flex; align-items: center; gap: 12px; }

.view-toggle {
  display: flex; background: var(--bg-elevated);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  overflow: hidden;
}

.view-btn {
  background: none; border: none; color: var(--text-muted);
  padding: 6px 10px; cursor: pointer;
  font-size: 14px; transition: var(--transition);
}

.view-btn.active { background: var(--accent); color: white; }
.view-btn:hover:not(.active) { color: var(--text-primary); }

.sort-select {
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 6px 12px;
  color: var(--text-secondary); font-family: var(--font-body);
  font-size: 12.5px; outline: none; cursor: pointer;
  transition: var(--transition);
}
.sort-select:focus { border-color: var(--accent); color: var(--text-primary); }

/* ===== ENTRY FORM ===== */
.entry-form-section {
  padding: 24px 24px 0;
}

.form-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  position: relative;
}

.form-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--pink), var(--amber));
}

.form-card-header {
  display: flex; align-items: center; gap: 10px;
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--border);
  font-weight: 600; font-size: 13.5px; color: var(--text-secondary);
}

.form-card-header i { color: var(--accent); font-size: 16px; }
.form-card-header span { flex: 1; }

.form-close-btn {
  background: none; border: none; color: var(--text-muted);
  cursor: pointer; padding: 4px; border-radius: 6px;
  font-size: 14px; transition: var(--transition);
}
.form-close-btn:hover { background: var(--bg-elevated); color: var(--text-primary); }

/* Category selector */
.category-selector {
  display: flex; flex-wrap: wrap; gap: 6px;
  padding: 14px 20px 10px;
}

.cat-btn {
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: 20px; padding: 5px 12px;
  color: var(--text-secondary); font-family: var(--font-body);
  font-size: 12px; cursor: pointer; transition: var(--transition);
  white-space: nowrap;
}

.cat-btn:hover { border-color: var(--accent); color: var(--text-primary); }
.cat-btn.active {
  background: rgba(99,102,241,0.2); border-color: var(--accent);
  color: #818cf8; font-weight: 500;
}

.cat-btn i { font-size: 11px; }

/* Form inputs */
.form-row-group {
  display: flex; align-items: center; gap: 12px;
  padding: 0 20px 10px;
}

.form-group-main { flex: 1; }

.form-input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 14px;
  outline: none;
  transition: var(--transition);
  resize: none;
}

.form-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.form-input::placeholder { color: var(--text-muted); }

.title-input {
  font-size: 15px; font-weight: 500;
  background: transparent; border: none; border-bottom: 1px solid var(--border);
  border-radius: 0; padding: 8px 0;
}
.title-input:focus { border-color: var(--accent); box-shadow: none; }

.content-input { margin: 0 20px; width: calc(100% - 40px); min-height: 80px; }

.form-group { padding: 0 20px 10px; }

/* Color picker */
.color-picker-wrap { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.color-label { font-size: 11px; color: var(--text-muted); white-space: nowrap; }
.color-dots { display: flex; gap: 5px; }
.color-dot {
  width: 18px; height: 18px; border-radius: 50%;
  cursor: pointer; transition: var(--transition);
  border: 2px solid transparent;
}
.color-dot.active, .color-dot:hover { border-color: white; transform: scale(1.2); }

/* Bottom row */
.form-bottom-row {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
  padding: 12px 20px 16px;
  border-top: 1px solid var(--border);
  background: var(--bg-base);
}

.tags-wrap, .source-wrap, .collection-wrap {
  display: flex; align-items: center; gap: 6px;
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: 20px; padding: 5px 12px; flex: 1; min-width: 120px;
}
.tags-wrap i, .source-wrap i, .collection-wrap i { color: var(--text-muted); font-size: 12px; }

.tags-input, .source-input, .collection-select {
  background: none; border: none; outline: none;
  color: var(--text-primary); font-family: var(--font-body);
  font-size: 12.5px; width: 100%;
}
.tags-input::placeholder, .source-input::placeholder { color: var(--text-muted); }
.collection-select { cursor: pointer; }
.collection-select option { background: var(--bg-elevated); color: var(--text-primary); }

.fav-toggle {
  display: flex; align-items: center; gap: 5px;
  cursor: pointer; color: var(--text-secondary); font-size: 12.5px;
  white-space: nowrap;
}
.fav-toggle input { display: none; }
.fav-toggle i { transition: var(--transition); }
.fav-toggle:has(input:checked) i { color: var(--amber); }
.fav-toggle:has(input:checked) { color: var(--amber); }

.save-btn {
  background: linear-gradient(135deg, var(--accent), #818cf8);
  border: none; border-radius: 20px;
  padding: 8px 20px;
  color: white; font-family: var(--font-body);
  font-size: 13px; font-weight: 600;
  cursor: pointer; transition: var(--transition);
  display: flex; align-items: center; gap: 6px;
  box-shadow: 0 4px 14px var(--accent-glow);
  white-space: nowrap;
}
.save-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 20px var(--accent-glow); }
.save-btn:active { transform: translateY(0); }

/* Image upload */
.image-drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 30px; text-align: center;
  color: var(--text-muted); cursor: pointer;
  transition: var(--transition);
}
.image-drop-zone:hover, .image-drop-zone.drag-over {
  border-color: var(--accent); color: var(--text-primary);
  background: rgba(99,102,241,0.05);
}
.image-drop-zone i { font-size: 32px; display: block; margin-bottom: 8px; }
.image-drop-zone p { font-size: 13px; margin: 0; }

.upload-label { color: var(--accent); cursor: pointer; }
.upload-label:hover { text-decoration: underline; }

.image-preview-wrap img {
  max-width: 100%; max-height: 200px;
  border-radius: var(--radius-sm); object-fit: contain;
  margin-top: 8px;
}

.youtube-preview-wrap {
  margin: 0 20px 10px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  aspect-ratio: 16/9;
}
.youtube-preview-wrap iframe { width: 100%; height: 100%; border: none; }

/* ===== ENTRIES SECTION ===== */
.entries-section { padding: 20px 24px 40px; }

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

.entries-count {
  font-size: 12px; color: var(--text-muted);
  font-family: var(--font-mono);
}

.new-entry-fab {
  width: 36px; height: 36px;
  background: var(--accent); border: none; border-radius: 50%;
  color: white; font-size: 18px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 14px var(--accent-glow);
  transition: var(--transition);
}
.new-entry-fab:hover { transform: rotate(45deg) scale(1.1); }

/* ===== CARDS — GRID VIEW ===== */
.entries-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.entry-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4,0,0.2,1);
  position: relative;
  display: flex; flex-direction: column;
  animation: cardIn 0.3s ease both;
}

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

.entry-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--card-color, var(--accent));
  transition: var(--transition);
}

.entry-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.entry-card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px 10px;
}

.entry-cat-tag {
  display: flex; align-items: center; gap: 5px;
  font-size: 10px; text-transform: uppercase; letter-spacing: 1px;
  color: var(--card-color, var(--accent));
  font-weight: 600; font-family: var(--font-mono);
}

.card-fav-btn {
  background: none; border: none; color: var(--text-muted);
  cursor: pointer; font-size: 14px; padding: 2px;
  transition: var(--transition); line-height: 1;
}
.card-fav-btn.active { color: var(--amber); }
.card-fav-btn:hover { transform: scale(1.2); }

.entry-card-img {
  width: 100%; aspect-ratio: 16/9; object-fit: cover;
}

.entry-card-body { padding: 0 16px 12px; flex: 1; }

.entry-card-title {
  font-family: var(--font-display);
  font-size: 15px; font-weight: 600;
  color: var(--text-primary); margin-bottom: 6px;
  line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
}

.entry-card-content {
  font-size: 12.5px; color: var(--text-secondary);
  line-height: 1.6;
  display: -webkit-box; -webkit-line-clamp: 3;
  -webkit-box-orient: vertical; overflow: hidden;
}

.entry-card-url {
  display: flex; align-items: center; gap: 5px;
  font-size: 11px; color: var(--accent);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  margin-top: 6px;
}

.entry-card-footer {
  padding: 8px 16px 12px;
  display: flex; align-items: center; justify-content: space-between;
  border-top: 1px solid var(--border);
}

.entry-card-date {
  font-size: 10.5px; color: var(--text-muted);
  font-family: var(--font-mono);
}

.entry-card-tags {
  display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end;
}

.tag-pill {
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: 20px; padding: 1px 7px;
  font-size: 10px; color: var(--text-muted);
}

/* ===== LIST VIEW ===== */
.entries-list .entry-card {
  display: flex; flex-direction: row;
  border-radius: var(--radius-sm);
}

.entries-list .entry-card::before {
  top: 0; bottom: 0; right: auto;
  width: 3px; height: auto;
}

.entries-list .entry-card-img {
  width: 100px; height: 70px; aspect-ratio: unset;
  object-fit: cover; flex-shrink: 0; border-radius: 0;
}

.entries-list .entry-card-header { padding: 12px 12px 0; }
.entries-list .entry-card-body { padding: 4px 12px 8px; }
.entries-list .entry-card-footer { padding: 4px 12px 8px; border: none; }
.entries-list .entry-card-title { font-size: 14px; -webkit-line-clamp: 1; }
.entries-list .entry-card-content { -webkit-line-clamp: 2; }

/* ===== TIMELINE VIEW ===== */
.entries-timeline {
  display: flex; flex-direction: column; gap: 0;
  position: relative;
}

.entries-timeline::before {
  content: '';
  position: absolute; left: 120px; top: 0; bottom: 0;
  width: 1px; background: var(--border);
}

.timeline-group { display: flex; gap: 0; margin-bottom: 24px; }

.timeline-date-label {
  width: 110px; flex-shrink: 0;
  text-align: right; padding-right: 24px; padding-top: 14px;
  font-size: 11px; color: var(--text-muted);
  font-family: var(--font-mono); line-height: 1.4;
  position: relative;
}

.timeline-date-label::after {
  content: '';
  position: absolute; right: -5px; top: 18px;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--accent); border: 2px solid var(--bg-base);
}

.timeline-cards { flex: 1; padding-left: 24px; display: flex; flex-direction: column; gap: 10px; }

/* ===== EMPTY STATE ===== */
.empty-state {
  text-align: center; padding: 80px 20px;
  color: var(--text-muted);
}
.empty-state i { font-size: 56px; display: block; margin-bottom: 16px; opacity: 0.3; }
.empty-state h3 { font-family: var(--font-display); font-size: 22px; margin-bottom: 8px; }
.empty-state p { font-size: 13.5px; }

/* ===== PAGINATION ===== */
.pagination-wrap {
  display: flex; align-items: center; justify-content: center;
  gap: 12px; margin-top: 32px;
}

.page-btn {
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 7px 14px;
  color: var(--text-secondary); cursor: pointer;
  transition: var(--transition);
}
.page-btn:hover:not(:disabled) { border-color: var(--accent); color: var(--text-primary); }
.page-btn:disabled { opacity: 0.3; cursor: not-allowed; }

#pageInfo { font-size: 12.5px; color: var(--text-muted); font-family: var(--font-mono); }

/* ===== DETAIL MODAL ===== */
.detail-modal-content {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); color: var(--text-primary);
}

.detail-modal-header {
  border-bottom: 1px solid var(--border);
  padding: 20px 24px;
  position: relative;
  background: var(--bg-base);
}

.detail-modal-header::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--modal-color, var(--accent));
}

.detail-modal-cat {
  font-size: 10px; text-transform: uppercase; letter-spacing: 1.5px;
  color: var(--modal-color, var(--accent)); font-weight: 600;
  margin-bottom: 4px; font-family: var(--font-mono);
}

.detail-modal-title {
  font-family: var(--font-display); font-size: 22px;
  font-weight: 600; color: var(--text-primary); margin: 0;
  line-height: 1.3;
}

.detail-modal-actions { display: flex; gap: 6px; align-self: flex-start; margin-left: auto; padding-left: 16px; }

.icon-action-btn {
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 7px 10px;
  color: var(--text-secondary); cursor: pointer;
  font-size: 14px; transition: var(--transition);
}
.icon-action-btn:hover { border-color: var(--accent); color: var(--text-primary); }
.icon-action-btn.danger:hover { border-color: var(--red); color: var(--red); }
.icon-action-btn.starred i { color: var(--amber); }

.detail-modal-body { padding: 24px; }

.detail-image-wrap img {
  width: 100%; max-height: 400px; object-fit: contain;
  border-radius: var(--radius-sm); margin-bottom: 16px;
  background: var(--bg-elevated);
}

.detail-yt-wrap { margin-bottom: 16px; border-radius: var(--radius-sm); overflow: hidden; aspect-ratio: 16/9; }
.detail-yt-wrap iframe { width: 100%; height: 100%; border: none; }

.detail-url-wrap {
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px 14px;
  margin-bottom: 16px;
}
.detail-url-wrap a { color: var(--accent); text-decoration: none; font-size: 13.5px; display: flex; align-items: center; gap: 7px; }
.detail-url-wrap a:hover { text-decoration: underline; }
.detail-url-wrap a span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.detail-content {
  font-size: 14.5px; line-height: 1.8;
  color: var(--text-secondary); white-space: pre-wrap;
  margin-bottom: 16px;
}

.detail-source {
  display: flex; align-items: center; gap: 6px;
  font-size: 12.5px; color: var(--text-muted);
  margin-bottom: 12px;
}

.detail-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.detail-tags .tag-pill { font-size: 12px; padding: 3px 10px; }

.detail-meta {
  display: flex; flex-wrap: wrap; gap: 12px;
  font-size: 11px; color: var(--text-muted);
  font-family: var(--font-mono); border-top: 1px solid var(--border);
  padding-top: 12px;
}

/* ===== TOAST ===== */
.toast { background: var(--bg-elevated); border: 1px solid var(--border); }
.toast-body { font-size: 13px; color: var(--text-primary); }

/* ===== SIDEBAR OVERLAY ===== */
.sidebar-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.6); z-index: 99;
  backdrop-filter: blur(4px);
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 10px; }

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: var(--shadow);
  }
  .sidebar-overlay.open { display: block; }
  .main-content { margin-left: 0; }
  .sidebar-toggle { display: flex; }
  .sidebar-footer { width: var(--sidebar-width); }
}

@media (max-width: 640px) {
  .entry-form-section, .entries-section { padding: 14px 14px 0; }
  .entries-grid { grid-template-columns: 1fr; }
  .top-nav { padding: 0 14px; }
  .form-bottom-row { gap: 6px; }
  .tags-wrap, .source-wrap, .collection-wrap { min-width: 90px; }
  .category-selector { gap: 4px; }
  .cat-btn { padding: 4px 8px; font-size: 11px; }
  .color-picker-wrap { display: none; }
}

/* Category-specific card accent colors (applied via JS) */
[data-category="note"] { --card-color: #6366f1; }
[data-category="image"] { --card-color: #ec4899; }
[data-category="url"] { --card-color: #3b82f6; }
[data-category="quote"] { --card-color: #f59e0b; }
[data-category="blog"] { --card-color: #10b981; }
[data-category="youtube"] { --card-color: #ef4444; }
[data-category="file"] { --card-color: #8b5cf6; }
[data-category="other"] { --card-color: #6b7280; }
