:root {
  --primary: #00A82D;
  --primary-hover: #008f26;
  --primary-light: #e8f8ed;
  --bg-app: #f0f0ed;
  --bg-sidebar: #1e1e1e;
  --bg-sidebar-hover: #2d2d2d;
  --bg-sidebar-active: #3a3a3a;
  --bg-list: #f7f7f5;
  --bg-editor: #ffffff;
  --text-sidebar: #d4d4d4;
  --text-sidebar-muted: #888;
  --text-primary: #1a1a1a;
  --text-secondary: #6b7280;
  --text-muted: #9ca3af;
  --border: #e5e5e3;
  --border-light: #f0f0ed;
  --skeleton-base: #e8e8e5;
  --skeleton-shine: #f5f5f2;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.15);
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --sidebar-width: 220px;
  --list-width: 280px;
  --transition: 150ms ease;
}

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

html, body {
  height: 100%;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px;
  color: var(--text-primary);
  background: var(--bg-app);
  -webkit-font-smoothing: antialiased;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
  font-size: inherit;
}

input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

a { text-decoration: none; color: inherit; }

#app {
  height: 100vh;
  overflow: hidden;
}

/* ─── LOGIN ──────────────────────────────────────────────────────── */

.login-page {
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #f0f9f3 0%, #e8f8ed 50%, #f0f0ed 100%);
}

.login-card {
  background: var(--bg-editor);
  border-radius: var(--radius-lg);
  padding: 40px;
  width: 380px;
  box-shadow: var(--shadow-lg);
}

.login-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}

.login-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.login-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 28px;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.form-group input {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fafafa;
  font-size: 14px;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.form-group input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 168, 45, 0.12);
  background: white;
}

.login-error {
  background: #fff0f0;
  border: 1px solid #fcc;
  color: #c0392b;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: 16px;
}

.btn-primary {
  background: var(--primary);
  color: white;
  padding: 11px 20px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 14px;
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
}

.btn-primary:hover {
  background: var(--primary-hover);
  box-shadow: 0 2px 8px rgba(0, 168, 45, 0.3);
}

.btn-primary:active { transform: translateY(1px); }

.btn-primary:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

.btn-full { width: 100%; }

.btn-text { display: block; }
.btn-loading { display: flex; align-items: center; justify-content: center; gap: 8px; }

@keyframes spin {
  to { transform: rotate(360deg); }
}
.spin { animation: spin 0.8s linear infinite; }

/* ─── MAIN APP LAYOUT ────────────────────────────────────────────── */

.main-app {
  height: 100vh;
  display: flex;
  overflow: hidden;
}

/* ─── SIDEBAR ────────────────────────────────────────────────────── */

.sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  background: var(--bg-sidebar);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-right: 1px solid rgba(255,255,255,0.05);
}

.sidebar-header {
  padding: 16px 14px 12px;
}

.app-logo {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 15px;
  font-weight: 700;
  color: #ffffff;
}

.btn-new-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 0 12px 16px;
  padding: 10px;
  background: var(--primary);
  color: white;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 13px;
  transition: background var(--transition), box-shadow var(--transition);
}

.btn-new-note:hover {
  background: var(--primary-hover);
  box-shadow: 0 2px 8px rgba(0, 168, 45, 0.35);
}

.btn-new-note:active { transform: scale(0.98); }

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 0 8px;
  scrollbar-width: none;
}

.sidebar-nav::-webkit-scrollbar { display: none; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text-sidebar);
  transition: background var(--transition), color var(--transition);
  margin-bottom: 2px;
}

.nav-item:hover {
  background: var(--bg-sidebar-hover);
  color: white;
}

.nav-item.active {
  background: var(--bg-sidebar-active);
  color: white;
}

.nav-badge {
  margin-left: auto;
  font-size: 11px;
  color: var(--text-sidebar-muted);
  background: rgba(255,255,255,0.08);
  padding: 1px 6px;
  border-radius: 10px;
  min-width: 20px;
  text-align: center;
}

.nav-section {
  margin-top: 4px;
  margin-bottom: 4px;
}

.nav-section-header {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-sidebar-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: background var(--transition), color var(--transition);
  user-select: none;
}

.nav-section-header:hover {
  background: var(--bg-sidebar-hover);
  color: var(--text-sidebar);
}

.nav-section-header svg:first-child {
  transition: transform var(--transition);
  flex-shrink: 0;
}

.nav-section.expanded .nav-section-header svg:first-child {
  transform: rotate(90deg);
}

.nav-sub-list {
  display: none;
  padding-left: 4px;
  margin-top: 2px;
}

.nav-section.expanded .nav-sub-list {
  display: block;
}

.nav-sub-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px 6px 26px;
  font-size: 13px;
  color: var(--text-sidebar);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
  margin-bottom: 1px;
}

.nav-sub-item:hover {
  background: var(--bg-sidebar-hover);
  color: white;
}

.nav-sub-item.active {
  background: var(--bg-sidebar-active);
  color: white;
}

.nav-sub-item .sub-count {
  font-size: 11px;
  color: var(--text-sidebar-muted);
}

.sidebar-footer {
  padding: 12px 14px;
  border-top: 1px solid rgba(255,255,255,0.07);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.user-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}

.user-info span {
  font-size: 13px;
  color: var(--text-sidebar);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  color: var(--text-sidebar-muted);
  transition: background var(--transition), color var(--transition);
  flex-shrink: 0;
}

.btn-icon:hover {
  background: var(--bg-sidebar-hover);
  color: var(--text-sidebar);
}

/* ─── NOTE LIST PANEL ────────────────────────────────────────────── */

.note-list-panel {
  width: var(--list-width);
  min-width: var(--list-width);
  background: var(--bg-list);
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border);
}

.note-list-header {
  padding: 12px 12px 8px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-list);
  position: sticky;
  top: 0;
  z-index: 10;
}

.search-bar {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  background: white;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 7px 10px;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.search-bar:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 168, 45, 0.1);
}

.search-bar svg { color: var(--text-muted); flex-shrink: 0; }

.search-bar input {
  border: none;
  outline: none;
  background: none;
  flex: 1;
  font-size: 13px;
  color: var(--text-primary);
  min-width: 0;
}

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

.search-clear {
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  padding: 2px;
  border-radius: 3px;
  transition: background var(--transition), color var(--transition);
}

.search-clear:hover { background: var(--border); color: var(--text-secondary); }

.list-actions { flex-shrink: 0; }

.sort-dropdown { position: relative; }

.sort-dropdown .btn-icon {
  width: 32px;
  height: 32px;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
}

.sort-dropdown .btn-icon:hover { background: var(--border); }

.dropdown-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  min-width: 130px;
  z-index: 100;
  overflow: hidden;
}

.dropdown-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 9px 14px;
  font-size: 13px;
  color: var(--text-primary);
  transition: background var(--transition);
  cursor: pointer;
}

.dropdown-item:hover { background: var(--bg-app); }
.dropdown-item.active { color: var(--primary); font-weight: 600; }

.note-list-title-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px 6px;
}

.note-list-title-bar h2 {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}

.count-badge {
  font-size: 11px;
  color: var(--text-muted);
  background: var(--border);
  padding: 1px 7px;
  border-radius: 10px;
}

.note-list {
  flex: 1;
  overflow-y: auto;
  padding: 4px 8px 8px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.note-list::-webkit-scrollbar { width: 4px; }
.note-list::-webkit-scrollbar-track { background: transparent; }
.note-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.note-item {
  padding: 12px 10px;
  border-radius: var(--radius-md);
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: background var(--transition), border-color var(--transition), box-shadow var(--transition);
  margin-bottom: 3px;
}

.note-item:hover {
  background: rgba(0, 168, 45, 0.04);
  border-color: rgba(0, 168, 45, 0.15);
}

.note-item.active {
  background: rgba(0, 168, 45, 0.07);
  border-color: rgba(0, 168, 45, 0.25);
  box-shadow: 0 1px 4px rgba(0, 168, 45, 0.1);
}

.note-item-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}

.note-item.active .note-item-title { color: var(--primary); }

.note-item-date {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 5px;
}

.note-item-preview {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.note-item-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}

.tag-chip {
  font-size: 10px;
  padding: 2px 7px;
  background: var(--bg-app);
  color: var(--text-secondary);
  border-radius: 10px;
  border: 1px solid var(--border);
}

.note-item.active .tag-chip {
  background: var(--primary-light);
  border-color: rgba(0, 168, 45, 0.2);
  color: var(--primary);
}

/* ─── SKELETON SCREENS ───────────────────────────────────────────── */

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.skeleton {
  background: linear-gradient(90deg, var(--skeleton-base) 25%, var(--skeleton-shine) 50%, var(--skeleton-base) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s ease infinite;
  border-radius: 4px;
}

.skeleton-item {
  padding: 12px 10px;
  margin-bottom: 3px;
}

.skeleton-title { height: 14px; width: 75%; margin-bottom: 6px; }
.skeleton-date { height: 11px; width: 40%; margin-bottom: 7px; }
.skeleton-body { height: 12px; width: 95%; margin-bottom: 4px; }
.skeleton-body.short { width: 60%; }

.editor-skeleton {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.editor-skeleton-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-bottom: 1px solid var(--border);
}

.skeleton-toolbar-btn { width: 28px; height: 28px; border-radius: 4px; flex-shrink: 0; }
.skeleton-toolbar-sep { width: 1px; height: 20px; flex-shrink: 0; }

.editor-skeleton-content {
  padding: 32px 10% 32px;
}

.skeleton-editor-title { height: 28px; width: 55%; margin-bottom: 14px; }
.skeleton-editor-meta { height: 12px; width: 35%; margin-bottom: 24px; }
.skeleton-editor-line { height: 14px; width: 100%; margin-bottom: 10px; }
.skeleton-editor-line.short { width: 45%; }
.skeleton-editor-line.medium { width: 70%; }

/* ─── EDITOR PANEL ───────────────────────────────────────────────── */

.editor-panel {
  flex: 1;
  min-width: 0;
  background: var(--bg-editor);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.editor-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.editor-empty p {
  font-size: 16px;
  font-weight: 500;
  color: var(--text-secondary);
}

.editor-empty span {
  font-size: 13px;
  color: var(--text-muted);
}

.editor-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.editor-toolbar {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 8px 16px;
  border-bottom: 1px solid var(--border);
  background: #fafafa;
  flex-wrap: wrap;
  row-gap: 6px;
}

.toolbar-group {
  display: flex;
  align-items: center;
  gap: 1px;
}

.toolbar-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  transition: background var(--transition), color var(--transition);
}

.toolbar-btn:hover {
  background: var(--bg-app);
  color: var(--text-primary);
}

.toolbar-btn.active {
  background: var(--primary-light);
  color: var(--primary);
}

.toolbar-select {
  height: 30px;
  padding: 0 8px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: white;
  color: var(--text-primary);
  font-size: 12px;
  outline: none;
  cursor: pointer;
  transition: border-color var(--transition);
}

.toolbar-select:hover { border-color: var(--primary); }
.toolbar-select:focus { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(0,168,45,0.1); }

.toolbar-divider {
  width: 1px;
  height: 20px;
  background: var(--border);
  margin: 0 4px;
  flex-shrink: 0;
}

.toolbar-spacer { flex: 1; }

.save-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
  padding: 0 8px;
  white-space: nowrap;
}

.save-status.saving #save-text { color: var(--text-secondary); }
.save-status.saved #save-text { color: var(--primary); }

.btn-danger { color: #9ca3af; }
.btn-danger:hover { background: #fff0f0; color: #ef4444; }

.editor-body {
  flex: 1;
  overflow-y: auto;
  padding: 32px 10%;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.editor-body::-webkit-scrollbar { width: 5px; }
.editor-body::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.note-title-input {
  display: block;
  width: 100%;
  border: none;
  outline: none;
  font-size: 26px;
  font-weight: 700;
  color: var(--text-primary);
  background: none;
  margin-bottom: 8px;
  line-height: 1.3;
}

.note-title-input::placeholder { color: var(--text-muted); }

.note-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.meta-sep { color: var(--border); }

.meta-select {
  border: none;
  outline: none;
  background: none;
  color: var(--text-muted);
  font-size: 12px;
  cursor: pointer;
  padding: 0;
}

.meta-select:hover { color: var(--primary); }

.note-tags-container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  min-height: 24px;
  margin-bottom: 20px;
}

.note-tags { display: flex; flex-wrap: wrap; gap: 5px; }

.note-tag-chip {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  padding: 3px 10px 3px 10px;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: 12px;
  border: 1px solid rgba(0,168,45,0.2);
}

.note-tag-chip button {
  display: flex;
  align-items: center;
  color: var(--primary);
  opacity: 0.6;
  transition: opacity var(--transition);
}

.note-tag-chip button:hover { opacity: 1; }

.tag-input {
  border: none;
  outline: none;
  background: none;
  font-size: 12px;
  color: var(--text-primary);
  min-width: 80px;
  padding: 3px 0;
}

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

.note-editor {
  min-height: 400px;
  outline: none;
  font-size: 15px;
  line-height: 1.75;
  color: var(--text-primary);
  caret-color: var(--primary);
}

.note-editor:empty::before {
  content: '開始輸入筆記內容...';
  color: var(--text-muted);
  pointer-events: none;
}

.note-editor p { margin-bottom: 6px; }
.note-editor ul, .note-editor ol { padding-left: 24px; margin-bottom: 6px; }
.note-editor li { margin-bottom: 3px; }
.note-editor strong { font-weight: 700; }
.note-editor em { font-style: italic; }
.note-editor a { color: var(--primary); text-decoration: underline; }

/* ─── EMPTY STATE ────────────────────────────────────────────────── */

.empty-list {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  gap: 8px;
  color: var(--text-muted);
  font-size: 13px;
  text-align: center;
}

.empty-list svg { margin-bottom: 4px; }

/* ─── UTILITIES ──────────────────────────────────────────────────── */

[hidden] { display: none !important; }

/* ─── SIDEBAR FOOTER ACTIONS ─────────────────────────────────────── */

.sidebar-footer-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}

/* ─── MODAL ──────────────────────────────────────────────────────── */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(2px);
  animation: fadeIn 150ms ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-card {
  background: var(--bg-editor);
  border-radius: var(--radius-lg);
  padding: 28px 32px 24px;
  width: 420px;
  max-width: calc(100vw - 32px);
  box-shadow: var(--shadow-lg);
  animation: slideUp 180ms ease;
}

.modal-card-wide {
  width: 80vw;
  max-width: 1000px;
  height: 80vh;
  display: flex;
  flex-direction: column;
  padding: 20px 24px 16px;
}

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

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

.modal-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
}

.modal-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  transition: background var(--transition), color var(--transition);
  flex-shrink: 0;
}

.modal-close:hover {
  background: var(--bg-app);
  color: var(--text-primary);
}

.modal-msg {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: 14px;
}

.modal-msg-error {
  background: #fff0f0;
  border: 1px solid #fcc;
  color: #c0392b;
}

.modal-msg-success {
  background: var(--primary-light);
  border: 1px solid rgba(0, 168, 45, 0.25);
  color: var(--primary);
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 6px;
}

.btn-secondary {
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-weight: 500;
  font-size: 14px;
  color: var(--text-secondary);
  background: var(--bg-app);
  border: 1.5px solid var(--border);
  transition: background var(--transition), border-color var(--transition);
}

.btn-secondary:hover {
  background: var(--border);
  border-color: var(--text-muted);
}

/* ─── PDF PREVIEW ────────────────────────────────────────────────── */

.pdf-preview-body {
  flex: 1;
  overflow: hidden;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

.pdf-preview-body iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

.pdf-embed-block {
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin: 8px 0;
  background: var(--bg-list);
  user-select: none;
}

.pdf-embed-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  color: var(--text-secondary);
}

.pdf-embed-header svg {
  flex-shrink: 0;
  color: #e74c3c;
}

.pdf-embed-name {
  flex: 1;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pdf-preview-btn {
  padding: 5px 12px;
  background: var(--primary);
  color: white;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  transition: background var(--transition);
  flex-shrink: 0;
  cursor: pointer;
}

.pdf-preview-btn:hover {
  background: var(--primary-hover);
}

/* ─── RESIZE HANDLE ──────────────────────────────────────────────── */

.resize-handle {
  width: 4px;
  flex-shrink: 0;
  background: transparent;
  cursor: col-resize;
  transition: background var(--transition);
  position: relative;
  z-index: 10;
}

.resize-handle:hover,
.resize-handle.dragging {
  background: var(--primary);
}

/* ─── ADD NOTEBOOK BUTTON ────────────────────────────────────────── */

.nav-section-header {
  position: relative;
}

.btn-add-notebook {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: var(--radius-sm);
  color: var(--text-sidebar-muted);
  margin-left: auto;
  opacity: 0;
  transition: opacity var(--transition), background var(--transition), color var(--transition);
  flex-shrink: 0;
}

.nav-section-header:hover .btn-add-notebook {
  opacity: 1;
}

.btn-add-notebook:hover {
  background: var(--bg-sidebar-active);
  color: white;
}

/* ─── ADD NOTEBOOK MODAL (narrow) ───────────────────────────────── */

.modal-card-narrow {
  width: 340px;
}

/* ─── TOAST NOTIFICATION ────────────────────────────────────────── */

.app-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #1e1e1e;
  color: white;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-size: 13px;
  z-index: 9999;
  opacity: 0;
  transition: opacity 200ms, transform 200ms;
  pointer-events: none;
  white-space: nowrap;
}

.app-toast-show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.app-toast-warn { background: #d97706; }
.app-toast-error { background: #dc2626; }
.app-toast-success { background: var(--primary); }

/* ─── DRAG-AND-DROP HIGHLIGHT ───────────────────────────────────── */

.note-editor.drag-over {
  outline: 2px dashed var(--primary);
  outline-offset: -4px;
  background: var(--primary-light);
}

