/* ===========================
   ZİHİN — style.css (v2)
   =========================== */

:root {
  --bg:        #0d0f14;
  --surface:   #13161e;
  --surface2:  #1a1e2a;
  --surface3:  #20253a;
  --border:    rgba(255,255,255,0.07);
  --border2:   rgba(255,255,255,0.12);
  --accent:    #7c6af7;
  --accent2:   #a78bfa;
  --accent3:   #f472b6;
  --text:      #e8eaf0;
  --text-muted:#6b7280;
  --text-dim:  #9ca3af;
  --quote-bg:  #16111d;
  --danger:    #ef4444;
  --sidebar-w: 260px;
  --todo-w:    280px;
  --radius:    12px;
  --radius-sm: 8px;
  --radius-xs: 6px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-only { display: none; }

@media (max-width: 768px) {
  .mobile-only { display: flex; }
}

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

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  line-height: 1.6;
  overflow: hidden;
}

/* ════════════════════════════
   AUTH SCREEN
════════════════════════════ */
#auth-screen {
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse at 30% 40%, rgba(124,106,247,0.12) 0%, transparent 60%),
              radial-gradient(ellipse at 70% 70%, rgba(244,114,182,0.08) 0%, transparent 60%),
              var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 500;
}
#auth-card {
  width: 380px;
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: 20px;
  padding: 36px 32px;
  box-shadow: 0 32px 80px rgba(0,0,0,0.6),
              0 0 0 1px rgba(255,255,255,0.04) inset;
  animation: slideUp 0.4s cubic-bezier(0.16,1,0.3,1);
}
@keyframes slideUp {
  from { opacity:0; transform: translateY(24px); }
  to   { opacity:1; transform: translateY(0); }
}
.auth-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
  margin-bottom: 8px;
}
.logo-icon {
  font-size: 26px;
  background: linear-gradient(135deg, var(--accent), var(--accent3));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.logo-text {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.5px;
  background: linear-gradient(135deg, var(--accent2), var(--accent3));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.auth-tagline {
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  margin-bottom: 28px;
}

/* Google button wrapper */
#google-signin-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}
/* Divider */
.auth-divider {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-muted);
  font-size: 11px;
}
.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border2);
}
.auth-divider span { white-space: nowrap; }
.auth-section-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 10px;
}
#user-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}
#app-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.mobile-nav-controls {
  display: none;
  gap: 12px;
}

@media (max-width: 768px) {
  .mobile-nav-controls { display: flex; align-items: center; }
  .mobile-menu-trigger {
    background: var(--surface2);
    border: none;
    color: var(--text);
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
  }
}

.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  z-index: 90;
  display: none;
}
.sidebar-overlay.active { display: block; }
.user-list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.18s;
}
.user-list-item:hover {
  border-color: var(--accent);
  background: var(--surface3);
}
.user-list-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent3));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  color: #fff;
  flex-shrink: 0;
}
.user-list-name {
  font-size: 14px;
  font-weight: 500;
}
.user-list-hint { font-size: 11px; color: var(--text-muted); }

.auth-actions-row { display: flex; gap: 8px; margin-top: 10px; }
.flex-1 { flex: 1; }

.auth-back-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}
.auth-username-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--accent2);
}
.input-wrap { margin-bottom: 10px; }
.input-wrap input {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 12px 14px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
  font-family: 'Inter', sans-serif;
}
.input-wrap input:focus { border-color: var(--accent); }
.input-wrap input::placeholder { color: var(--text-muted); }

.auth-error {
  color: var(--danger);
  font-size: 12px;
  margin-bottom: 10px;
  padding: 8px 12px;
  background: rgba(239,68,68,0.1);
  border-radius: var(--radius-xs);
}

/* ════════════════════════════
   APP LAYOUT
════════════════════════════ */
#app {
  display: flex;
  height: 100vh;
}

#sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  height: 100vh;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  transition: transform var(--transition);
  z-index: 100;
  padding: 16px 14px;
  gap: 12px;
  overflow: hidden;
}

@media (max-width: 768px) {
  #sidebar {
    position: fixed;
    left: 0;
    top: 0;
    transform: translateX(-100%);
  }
  #sidebar.active {
    transform: translateX(0);
    box-shadow: 20px 0 50px rgba(0,0,0,0.5);
  }
}

#main {
  flex: 1;
  height: 100vh;
  overflow: auto;
  display: flex;
  flex-direction: column;
  position: relative;
}

#todo-sidebar {
  width: var(--todo-w);
  min-width: var(--todo-w);
  height: 100vh;
  background: #0d0b14; /* Extremely deep dark */
  border-left: 1px solid var(--border2);
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
  position: relative;
  transition: transform var(--transition);
  z-index: 100;
}

@media (max-width: 768px) {
  #todo-sidebar {
    position: fixed;
    right: 0;
    top: 0;
    transform: translateX(100%);
  }
  #todo-sidebar.active {
    transform: translateX(0);
    box-shadow: -20px 0 50px rgba(0,0,0,0.5);
  }
}

#todo-sidebar::before {
  content: "";
  position: absolute;
  left: 45px;
  top: 0;
  bottom: 0;
  width: 1px;
  background: linear-gradient(to bottom, transparent, var(--accent), transparent);
  opacity: 0.3;
  z-index: 1;
}

.todo-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 24px 20px 24px 60px;
  gap: 16px;
  z-index: 2;
  position: relative;
}

/* ════════════════════════════
   SIDEBAR ELEMENTS
════════════════════════════ */
#logo {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 2px 0 6px;
  border-radius: var(--radius-xs);
  transition: opacity 0.18s;
}
#logo:hover { opacity: 0.75; }

#user-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: var(--surface2);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
#user-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent3));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}
#user-display-name {
  flex: 1;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#logout-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px 4px;
  font-size: 13px;
  border-radius: 4px;
  transition: color 0.2s;
}
#logout-btn:hover { color: var(--danger); }

#search-wrap {
  position: relative;
}
#search-input {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  padding: 8px 12px 8px 34px;
  color: var(--text);
  font-size: 12px;
  outline: none;
  transition: border-color 0.2s;
}
#search-input:focus { border-color: var(--accent); }
#search-input::placeholder { color: var(--text-muted); }
.search-icon {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 15px;
  pointer-events: none;
}

#nav-tabs {
  display: flex;
  gap: 3px;
  background: var(--surface2);
  border-radius: var(--radius-xs);
  padding: 3px;
}
.tab-btn {
  flex: 1;
  padding: 5px 4px;
  background: transparent;
  border: none;
  border-radius: 5px;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 11px;
  font-weight: 500;
  transition: all 0.2s;
  white-space: nowrap;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { background: var(--accent); color: #fff; }

#list-panel {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
#list-panel::-webkit-scrollbar { width: 3px; }
#list-panel::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

/* Folder items in sidebar */
.folder-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 11px;
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: background 0.15s;
  border: 1px solid transparent;
}
.folder-item:hover { background: var(--surface2); }
.folder-item.active {
  background: rgba(124,106,247,0.12);
  border-color: rgba(124,106,247,0.3);
}
.folder-emoji { font-size: 15px; }
.folder-label { font-size: 13px; font-weight: 500; flex: 1; }
.folder-count {
  font-size: 10px;
  background: var(--surface3);
  color: var(--text-muted);
  padding: 1px 6px;
  border-radius: 99px;
}

.list-item {
  padding: 9px 11px;
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: background 0.15s;
  border: 1px solid transparent;
}
.list-item:hover { background: var(--surface2); }
.list-item.active {
  background: rgba(124,106,247,0.12);
  border-color: rgba(124,106,247,0.3);
}
.list-item-title {
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.list-item-meta { font-size: 10px; color: var(--text-muted); margin-top: 2px; }
.list-item-tags { display: flex; gap: 3px; flex-wrap: wrap; margin-top: 4px; }

.chip {
  font-size: 10px;
  padding: 1px 7px;
  border-radius: 99px;
  background: rgba(124,106,247,0.15);
  color: var(--accent2);
  border: 1px solid rgba(124,106,247,0.2);
}
.chip-pink {
  background: rgba(244,114,182,0.12);
  color: var(--accent3);
  border-color: rgba(244,114,182,0.2);
}

.empty-msg {
  text-align: center;
  color: var(--text-muted);
  font-size: 11px;
  padding: 16px 0;
}

#new-btn {
  background: linear-gradient(135deg, var(--accent), var(--accent3));
  border: none;
  border-radius: var(--radius-xs);
  color: #fff;
  padding: 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.15s;
}
#new-btn:hover { opacity: 0.85; transform: translateY(-1px); }

/* ════════════════════════════
   WELCOME
════════════════════════════ */
#welcome-screen {
  margin: auto;
  text-align: center;
  max-width: 440px;
  padding: 40px 20px;
  animation: fadeIn 0.5s ease;
}
.welcome-icon {
  font-size: 56px;
  background: linear-gradient(135deg, var(--accent), var(--accent3));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 16px;
}
#welcome-title {
  font-size: 32px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent2), var(--accent3));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 10px;
}
.welcome-sub { color: var(--text-dim); font-size: 14px; margin-bottom: 28px; }
.welcome-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* ════════════════════════════
   FOLDER VIEW
════════════════════════════ */
#folder-view {
  padding: 24px 36px 32px;
  height: 100%;
  overflow-y: auto;
  animation: fadeIn 0.3s ease;
}
.app-back-row {
  margin-bottom: 20px;
}
.folder-view-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}
.folder-view-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
#folder-view-icon { font-size: 26px; }
#folder-view-name { font-size: 22px; font-weight: 700; }
#folder-notes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}
.note-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  cursor: pointer;
  transition: border-color 0.2s, transform 0.15s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 120px;
}
.note-card:hover {
  border-color: rgba(124,106,247,0.4);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(124,106,247,0.1);
}
.note-card-title {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
}
.note-card-preview {
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.6;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.note-card-date { font-size: 10px; color: var(--text-muted); }
.note-card-tags { display: flex; gap: 4px; flex-wrap: wrap; }
.folder-empty {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--text-muted);
  padding: 48px 0;
  font-size: 14px;
}

/* ════════════════════════════
   NOTE EDITOR
════════════════════════════ */
#note-editor, #quote-editor {
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 20px 36px 20px;
  gap: 14px;
  animation: fadeIn 0.3s ease;
}

.editor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.editor-breadcrumb {
  width: 100%;
  font-size: 11px;
  color: var(--text-muted);
}
.editor-breadcrumb span { color: var(--accent2); }

#note-title {
  flex: 1;
  background: transparent;
  border: none;
  border-bottom: 2px solid var(--border);
  color: var(--text);
  font-size: 22px;
  font-weight: 600;
  padding: 6px 2px;
  outline: none;
  font-family: 'Inter', sans-serif;
  transition: border-color 0.2s;
  min-width: 180px;
}
#note-title:focus { border-bottom-color: var(--accent); }
#note-title::placeholder { color: var(--text-muted); }

.editor-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
#note-folder-select {
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: var(--radius-xs);
  color: var(--text);
  padding: 6px 10px;
  font-size: 12px;
  outline: none;
  cursor: pointer;
}

#note-body {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: 'Lora', serif;
  font-size: 15px;
  line-height: 1.9;
  padding: 20px 24px;
  outline: none;
  resize: none;
  transition: border-color 0.2s;
}
#note-body:focus { border-color: rgba(124,106,247,0.4); }
#note-body::placeholder { color: var(--text-muted); font-style: italic; }

#bottom-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

#links-section {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  padding: 12px 16px;
  min-width: 220px;
}
#links-section h4 {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 8px;
}
#linked-notes-list { display: flex; flex-wrap: wrap; gap: 6px; }
.link-chip {
  font-size: 11px;
  padding: 3px 11px;
  border-radius: 99px;
  background: rgba(124,106,247,0.12);
  color: var(--accent2);
  border: 1px solid rgba(124,106,247,0.25);
  cursor: pointer;
  transition: background 0.2s;
}
.link-chip:hover { background: rgba(124,106,247,0.22); }

#tags-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 200px;
}
#tag-input, #quote-tag-input {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  color: var(--text);
  padding: 8px 12px;
  font-size: 12px;
  outline: none;
  transition: border-color 0.2s;
}
#tag-input:focus, #quote-tag-input:focus { border-color: var(--accent); }
#tag-input::placeholder, #quote-tag-input::placeholder { color: var(--text-muted); }
#tags-display, #quote-tags-display { display: flex; flex-wrap: wrap; gap: 5px; }

/* ════════════════════════════
   QUOTE EDITOR
════════════════════════════ */
#quote-editor { gap: 14px; }
#quote-editor h2 { font-size: 20px; font-weight: 600; flex:1; }
#quote-body {
  flex: 1;
  background: var(--quote-bg);
  border: 1px solid rgba(244,114,182,0.2);
  border-left: 4px solid var(--accent3);
  border-radius: var(--radius);
  color: var(--text);
  font-family: 'Lora', serif;
  font-size: 16px;
  font-style: italic;
  line-height: 1.9;
  padding: 22px 26px;
  outline: none;
  resize: none;
  min-height: 130px;
  transition: border-color 0.2s;
}
#quote-body:focus { border-left-color: var(--accent3); border-color: rgba(244,114,182,0.35); }
#quote-body::placeholder { color: var(--text-muted); }
.quote-meta { display: flex; gap: 10px; flex-wrap: wrap; }
.quote-meta input {
  flex: 1;
  min-width: 130px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  color: var(--text);
  padding: 8px 12px;
  font-size: 12px;
  outline: none;
  transition: border-color 0.2s;
}
.quote-meta input:focus { border-color: var(--accent3); }
.quote-meta input::placeholder { color: var(--text-muted); }
#quote-tags-section { display: flex; flex-direction: column; gap: 6px; }

/* ════════════════════════════
   GRAPH
════════════════════════════ */
#graph-view {
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100vh;
  padding: 28px 32px;
}
.graph-title {
  font-size: 20px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent2), var(--accent3));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.graph-subtitle { color: var(--text-muted); font-size: 12px; margin: 6px 0 16px; }
#graph-canvas {
  flex: 1;
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: grab;
}
#graph-canvas:active { cursor: grabbing; }
#graph-tooltip {
  position: fixed;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  padding: 5px 10px;
  font-size: 12px;
  pointer-events: none;
  display: none;
  z-index: 100;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}

/* ════════════════════════════
   SEARCH RESULTS
════════════════════════════ */
#search-results { padding: 28px 36px; animation: fadeIn 0.3s ease; }
.section-heading { font-size: 18px; font-weight: 600; margin-bottom: 18px; }
#results-list { display: flex; flex-direction: column; gap: 10px; }
.result-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  cursor: pointer;
  transition: border-color 0.2s, transform 0.15s;
}
.result-card:hover { border-color: var(--accent); transform: translateY(-1px); }
.result-card-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 5px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.result-type-badge {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 99px;
  font-weight: 500;
}
.badge-note   { background: rgba(124,106,247,0.15); color: var(--accent2); }
.badge-quote  { background: rgba(244,114,182,0.12); color: var(--accent3); }
.result-snippet { font-size: 12px; color: var(--text-dim); line-height: 1.6; }
.highlight { background: rgba(124,106,247,0.25); color: var(--accent2); border-radius: 2px; padding: 0 2px; }

/* ════════════════════════════
   TODO SIDEBAR
════════════════════════════ */
.todo-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 2px 0 6px;
}
.todo-icon {
  font-size: 18px;
  color: var(--accent);
}
.todo-header h3 { 
  font-size: 16px; 
  font-weight: 600; 
  color: var(--text);
  letter-spacing: 0.8px;
  text-transform: uppercase;
  background: linear-gradient(135deg, #fff, var(--text-dim));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.todo-input-row { display: flex; gap: 8px; margin-bottom: 5px; }
#todo-input {
  flex: 1;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  padding: 8px 0;
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition: all 0.3s;
}
#todo-input:focus { border-bottom-color: var(--accent); }
#todo-input::placeholder { color: var(--text-muted); opacity: 0.5; }

#todo-container {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  background-image: repeating-linear-gradient(transparent, transparent 31px, rgba(124, 106, 247, 0.08) 31px, rgba(124, 106, 247, 0.08) 32px);
  line-height: 32px;
}
#todo-container::-webkit-scrollbar { width: 3px; }
#todo-container::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 2px; }

.todo-item {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 32px;
  padding: 0;
  background: transparent;
  border: none;
  transition: all 0.2s;
}
.todo-item.done { opacity: 0.35; filter: grayscale(1); }
.todo-item.done .todo-text { text-decoration: line-through; }
.todo-checkbox {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  border: 1px solid var(--border);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: var(--surface2);
  transition: all 0.2s ease;
}
.todo-checkbox:hover { border-color: var(--accent); box-shadow: 0 0 10px rgba(124, 106, 247, 0.2); }
.todo-item.done .todo-checkbox { background: var(--accent); border-color: var(--accent); }
.todo-item.done .todo-checkbox::after {
  content: "✓"; color: #fff; font-size: 11px; font-weight: bold;
}
.todo-text {
  flex: 1;
  font-size: 13.5px;
  color: var(--text-dim);
  padding-top: 2px;
  transition: color 0.2s;
}
.todo-item:hover .todo-text { color: var(--text); }
.todo-del-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 12px;
  padding: 4px;
  opacity: 0;
  transition: opacity 0.2s, color 0.2s;
}
.todo-item:hover .todo-del-btn { opacity: 1; }
.todo-del-btn:hover { color: var(--danger); }

/* ════════════════════════════
   MODALS
════════════════════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
}
.modal-box {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  padding: 28px;
  width: 400px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.5);
  display: flex;
  flex-direction: column;
  gap: 14px;
  animation: slideUp 0.3s cubic-bezier(0.16,1,0.3,1);
}
#folder-modal h3 { font-size: 16px; font-weight: 600; }
.emoji-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.emoji-opt {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  border-radius: var(--radius-xs);
  background: var(--surface2);
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.15s;
}
.emoji-opt:hover { background: var(--surface3); }
.emoji-opt.selected { border-color: var(--accent); background: rgba(124,106,247,0.15); }
#folder-name-input {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: var(--radius-xs);
  color: var(--text);
  padding: 11px 14px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
  font-family: 'Inter', sans-serif;
}
#folder-name-input:focus { border-color: var(--accent); }
#folder-name-input::placeholder { color: var(--text-muted); }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; }

/* ════════════════════════════
   BUTTONS
════════════════════════════ */
.btn-primary {
  background: linear-gradient(135deg, var(--accent), #5b4dd4);
  border: none;
  border-radius: var(--radius-xs);
  color: #fff;
  padding: 9px 18px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.15s;
  font-family: 'Inter', sans-serif;
}
.btn-primary:hover { opacity: 0.85; transform: translateY(-1px); }
.btn-primary.full { width: 100%; padding: 12px; font-size: 14px; }
.btn-primary.sm   { padding: 7px 14px; font-size: 12px; }

.btn-secondary {
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: var(--radius-xs);
  color: var(--text);
  padding: 9px 18px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.2s;
  font-family: 'Inter', sans-serif;
}
.btn-secondary:hover { border-color: var(--accent); }

.btn-danger {
  background: transparent;
  border: 1px solid rgba(239,68,68,0.4);
  border-radius: var(--radius-xs);
  color: var(--danger);
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
  font-family: 'Inter', sans-serif;
}
.btn-danger:hover { background: rgba(239,68,68,0.1); }

.btn-ghost {
  background: transparent;
  border: 1px dashed var(--border2);
  border-radius: var(--radius-xs);
  color: var(--text-muted);
  padding: 9px 14px;
  font-size: 12px;
  cursor: pointer;
  width: 100%;
  transition: all 0.2s;
  font-family: 'Inter', sans-serif;
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent2); }

.btn-ghost-sm {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 4px 8px;
  font-size: 12px;
  cursor: pointer;
  border-radius: 4px;
  transition: color 0.18s, background 0.18s;
  font-family: 'Inter', sans-serif;
}
.btn-ghost-sm:hover { color: var(--text); background: var(--surface2); }
.btn-ghost-sm.danger:hover { color: var(--danger); }

/* ════════════════════════════
   UTILS
════════════════════════════ */
.hidden { display: none !important; }
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Scrollbar */
#main::-webkit-scrollbar,
#folder-view::-webkit-scrollbar,
#note-body::-webkit-scrollbar,
#quote-body::-webkit-scrollbar { width: 5px; }
#main::-webkit-scrollbar-thumb,
#folder-view::-webkit-scrollbar-thumb,
#note-body::-webkit-scrollbar-thumb,
#quote-body::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}
#main::-webkit-scrollbar-track,
#folder-view::-webkit-scrollbar-track,
#note-body::-webkit-scrollbar-track,
#quote-body::-webkit-scrollbar-track { background: transparent; }

/* Responsive */
@media (max-width: 800px) {
  #todo-sidebar { display: none; }
}
@media (max-width: 600px) {
  :root { --sidebar-w: 200px; }
  #note-editor, #quote-editor { padding: 16px 14px; }
  #folder-view { padding: 20px 16px; }
  #folder-notes-grid { grid-template-columns: 1fr; }
  #auth-card { width: calc(100vw - 32px); padding: 28px 20px; }
}
