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

html {
  font-size: 16px;
}

:root {
  --bg-primary: #0f0f0f;
  --bg-secondary: #1a1a1a;
  --bg-tertiary: #242424;
  --bg-hover: #2d2d2d;
  --border-color: #2a2a2a;
  --border-hover: #404040;
  --text-primary: #f5f5f5;
  --text-secondary: #a0a0a0;
  --text-muted: #666;
  --accent: #6366f1;
  --accent-hover: #818cf8;
  --importance-1: #3b82f6;
  --importance-2: #f59e0b;
  --importance-3: #ef4444;
  --success: #22c55e;
  --error: #ef4444;
}

body[data-theme="light"] {
  --bg-primary: #f8f9fa;
  --bg-secondary: #ffffff;
  --bg-tertiary: #f1f3f4;
  --bg-hover: #e8eaed;
  --border-color: #dadce0;
  --border-hover: #bdc1c6;
  --text-primary: #202124;
  --text-secondary: #5f6368;
  --text-muted: #9aa0a6;
  --accent: #1a73e8;
  --accent-hover: #1967d2;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
  overflow: hidden;
}

.app {
  display: flex;
  height: 100vh;
}

.sidebar {
  width: 300px;
  min-width: 300px;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sidebar_header {
  padding: 20px;
  border-bottom: 1px solid var(--border-color);
}

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

.sidebar_header h1 {
  font-size: 1.25rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar_header h1::before {
  content: '';
  width: 8px;
  height: 8px;
  background: var(--accent);
  border-radius: 50%;
}

.btn_icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: 0.2s ease;
}

.btn_icon:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border-color: var(--border-hover);
}

.btn_icon svg {
  width: 18px;
  height: 18px;
}

.search_box {
  position: relative;
}

.search_box input {
  width: 100%;
  padding: 10px 14px 10px 38px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  color: var(--text-primary);
  font-size: 0.875rem;
  transition: 0.2s ease;
}

.search_box input:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--bg-hover);
}

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

.search_box svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--text-muted);
}

.sort_box {
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.sort_box label {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.sort_box select {
  flex: 1;
  padding: 8px 10px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 0.8125rem;
  cursor: pointer;
  transition: 0.2s ease;
}

.sort_box select:focus {
  outline: none;
  border-color: var(--accent);
}

.btn_new {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px;
  margin-top: 12px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: 0.2s ease;
  position: relative;
}

.btn_new:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}

.btn_new:active {
  transform: translateY(0);
}

.btn_new svg {
  width: 18px;
  height: 18px;
}

.btn_new .shortcut {
  font-size: 0.6875rem;
  padding: 2px 6px;
  background: rgba(255,255,255,0.2);
  border-radius: 4px;
  margin-left: auto;
}

.notes_container {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
}

.notes_list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.note_item {
  padding: 14px 16px;
  background: var(--bg-tertiary);
  border: 1px solid transparent;
  border-radius: 10px;
  cursor: pointer;
  transition: 0.2s ease;
  position: relative;
  overflow: hidden;
}

.note_item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--importance-1);
  opacity: 0;
  transition: 0.2s ease;
}

.note_item[data-importance="1"]::before { background: var(--importance-1); }
.note_item[data-importance="2"]::before { background: var(--importance-2); }
.note_item[data-importance="3"]::before { background: var(--importance-3); }

.note_item:hover {
  background: var(--bg-hover);
  border-color: var(--border-hover);
}

.note_item:hover::before {
  opacity: 1;
}

.note_item.active {
  background: rgba(99, 102, 241, 0.15);
  border-color: var(--accent);
}

body[data-theme="light"] .note_item.active {
  background: rgba(26, 115, 232, 0.1);
}

.note_item.active::before {
  opacity: 1;
}

.note_item_title {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.note_item_preview {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.note_item_meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.note_item_date {
  display: flex;
  align-items: center;
  gap: 4px;
}

.importance_badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.6875rem;
  font-weight: 500;
  text-transform: uppercase;
}

.importance_badge[data-level="1"] {
  background: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
}

.importance_badge[data-level="2"] {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
}

.importance_badge[data-level="3"] {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
}

body[data-theme="light"] .importance_badge[data-level="1"] {
  background: rgba(59, 130, 246, 0.15);
  color: #2563eb;
}

body[data-theme="light"] .importance_badge[data-level="2"] {
  background: rgba(245, 158, 11, 0.15);
  color: #d97706;
}

body[data-theme="light"] .importance_badge[data-level="3"] {
  background: rgba(239, 68, 68, 0.15);
  color: #dc2626;
}

.empty_state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  text-align: center;
  color: var(--text-muted);
}

.empty_state svg {
  width: 48px;
  height: 48px;
  margin-bottom: 16px;
  opacity: 0.5;
}

.empty_state p {
  font-size: 0.875rem;
}

.sidebar_footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border-color);
}

.sidebar_link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.875rem;
  border-radius: 10px;
  transition: 0.2s ease;
}

.sidebar_link:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.sidebar_link svg {
  width: 18px;
  height: 18px;
}

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

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  min-height: 60px;
}

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

.toolbar_divider {
  width: 1px;
  height: 24px;
  background: var(--border-color);
  margin: 0 8px;
}

.btn_tool {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: 0.2s ease;
}

.btn_tool:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border-color: var(--border-color);
}

.btn_tool.active {
  background: rgba(99, 102, 241, 0.15);
  color: var(--accent);
  border-color: var(--accent);
}

.btn_tool svg {
  width: 18px;
  height: 18px;
}

.export_wrapper {
  position: relative;
}

.export_menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 8px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: 0.2s ease;
  z-index: 100;
  min-width: 180px;
}

.export_menu.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.export_menu button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px 16px;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 0.875rem;
  cursor: pointer;
  transition: 0.2s ease;
  text-align: left;
}

.export_menu button:hover {
  background: var(--bg-tertiary);
}

.export_menu button svg {
  width: 18px;
  height: 18px;
  color: var(--text-secondary);
}

.importance_selector {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  background: var(--bg-tertiary);
  border-radius: 6px;
}

.importance_btn {
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: 0.2s ease;
  font-size: 0.75rem;
  font-weight: 600;
}

.importance_btn[data-level="1"] {
  background: transparent;
  color: var(--importance-1);
}

.importance_btn[data-level="2"] {
  background: transparent;
  color: var(--importance-2);
}

.importance_btn[data-level="3"] {
  background: transparent;
  color: var(--importance-3);
}

.importance_btn.active[data-level="1"] {
  background: var(--importance-1);
  color: white;
}

.importance_btn.active[data-level="2"] {
  background: var(--importance-2);
  color: white;
}

.importance_btn.active[data-level="3"] {
  background: var(--importance-3);
  color: white;
}

.btn_delete {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: transparent;
  border: 1px solid var(--error);
  border-radius: 6px;
  color: var(--error);
  font-size: 0.8125rem;
  cursor: pointer;
  transition: 0.2s ease;
}

.btn_delete:hover {
  background: rgba(239, 68, 68, 0.15);
}

.btn_delete svg {
  width: 16px;
  height: 16px;
}

.editor_container {
  flex: 1;
  overflow-y: auto;
  padding: 32px;
  background: var(--bg-primary);
}

.editor {
  max-width: 800px;
  margin: 0 auto;
  animation: fadeIn 0.3s ease;
}

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

.editor_title {
  width: 100%;
  font-size: 2rem;
  font-weight: 700;
  background: transparent;
  border: none;
  color: var(--text-primary);
  outline: none;
  padding: 0;
  margin-bottom: 8px;
}

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

.editor_meta {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-bottom: 20px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.editor_meta span {
  display: flex;
  align-items: center;
  gap: 6px;
}

.editor_meta svg {
  width: 14px;
  height: 14px;
}

.editor_content {
  min-height: 400px;
  font-size: 1rem;
  line-height: 1.75;
  color: var(--text-primary);
  outline: none;
}

.editor_content:empty::before {
  content: attr(data-placeholder);
  color: var(--text-muted);
}

.editor_content p {
  margin-bottom: 1em;
}

.no_selection {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--text-muted);
  text-align: center;
}

.no_selection svg {
  width: 80px;
  height: 80px;
  margin-bottom: 24px;
  opacity: 0.3;
}

.no_selection h2 {
  font-size: 1.25rem;
  font-weight: 500;
  margin-bottom: 8px;
  color: var(--text-secondary);
}

.no_selection p {
  font-size: 0.875rem;
}

.modal_overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: 0.2s ease;
}

.modal_overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 24px;
  width: 90%;
  max-width: 400px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  transform: scale(0.95);
  transition: 0.2s ease;
}

.modal_overlay.active .modal {
  transform: scale(1);
}

.modal_icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(239, 68, 68, 0.15);
  border-radius: 50%;
  color: var(--error);
}

.modal_icon svg {
  width: 24px;
  height: 24px;
}

.modal h3 {
  font-size: 1.125rem;
  font-weight: 600;
  text-align: center;
  margin-bottom: 8px;
}

.modal p {
  font-size: 0.875rem;
  color: var(--text-secondary);
  text-align: center;
  margin-bottom: 24px;
}

.modal_actions {
  display: flex;
  gap: 12px;
}

.modal_actions button {
  flex: 1;
  padding: 12px;
  border-radius: 10px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: 0.2s ease;
}

.btn_cancel {
  width: 140px;
  height: 50px;
  transition: 0.2s;
  border-radius: 10px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
}

.btn_cancel:hover {
  background: var(--bg-hover);
  border-color: var(--border-hover);
  background-color: #1967d2;
}

.btn_confirm_delete {
  background: var(--error);
  border: none;
  color: white;
}

.btn_confirm_delete:hover {
  background: #f87171;
}

.toast_container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1001;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(100%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.toast.success {
  border-left: 3px solid var(--success);
}

.toast.error {
  border-left: 3px solid var(--error);
}

.toast svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.toast.success svg {
  color: var(--success);
}

.toast.error svg {
  color: var(--error);
}

.toast span {
  font-size: 0.875rem;
  color: var(--text-primary);
}

.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--bg-tertiary);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.status_indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.status_dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
}

.status_dot.saving {
  background: var(--importance-2);
  animation: pulse 1s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Pin button and badge */
.btn_pin {
  color: var(--text-muted);
}

.btn_pin.active {
  background: rgba(99, 102, 241, 0.15);
  color: var(--accent);
  border-color: var(--accent);
}

.btn_pin svg {
  width: 16px;
  height: 16px;
}

.note_item.pinned {
  border-left: 3px solid var(--accent);
}

.note_item.pinned::before {
  opacity: 0;
}

.note_pin_badge {
  position: absolute;
  top: 8px;
  right: 8px;
  color: var(--accent);
  opacity: 0.7;
}

.note_pin_badge svg {
  width: 14px;
  height: 14px;
}

/* Export Modal */
.modal_export {
  max-width: 500px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
}

.modal_header {
  text-align: center;
  margin-bottom: 16px;
}

.modal_header h3 {
  margin-bottom: 4px;
}

.modal_header p {
  margin-bottom: 0;
  color: var(--text-muted);
  font-size: 0.875rem;
}

.export_selection_controls {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.btn_small {
  padding: 8px 12px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  color: var(--text-secondary);
  font-size: 0.8125rem;
  cursor: pointer;
  transition: 0.2s ease;
}

.btn_small:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--border-hover);
}

.export_notes_list {
  flex: 1;
  overflow-y: auto;
  max-height: 300px;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  margin-bottom: 16px;
}

.export_section_title {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: var(--bg-tertiary);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
}

.export_section_title svg {
  width: 14px;
  height: 14px;
  color: var(--accent);
}

.export_item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  cursor: pointer;
  transition: 0.2s ease;
  border-bottom: 1px solid var(--border-color);
}

.export_item:last-child {
  border-bottom: none;
}

.export_item:hover {
  background: var(--bg-tertiary);
}

.export_item.selected {
  background: rgba(99, 102, 241, 0.1);
}

body[data-theme="light"] .export_item.selected {
  background: rgba(26, 115, 232, 0.08);
}

.export_checkbox {
  display: none;
}

.export_item_check {
  width: 22px;
  height: 22px;
  border: 2px solid var(--border-color);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: 0.2s ease;
}

.export_item_check svg {
  width: 14px;
  height: 14px;
  color: white;
  opacity: 0;
  transition: 0.2s ease;
}

.export_item.selected .export_item_check {
  background: var(--accent);
  border-color: var(--accent);
}

.export_item.selected .export_item_check svg {
  opacity: 1;
}

.export_item_content {
  flex: 1;
  min-width: 0;
}

.export_item_title {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 6px;
}

.export_item_title .pin_icon {
  width: 12px;
  height: 12px;
  color: var(--accent);
  flex-shrink: 0;
}

.export_item_preview {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

.export_actions {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}

.btn_export_action {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px 12px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  color: var(--text-primary);
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  transition: 0.2s ease;
}

.btn_export_action:hover:not(:disabled) {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.btn_export_action:hover:not(:disabled) svg {
  color: white;
}

.btn_export_action:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn_export_action svg {
  width: 24px;
  height: 24px;
  color: var(--text-secondary);
  transition: 0.2s ease;
}

.modal_footer {
  display: flex;
  justify-content: center;
}

.modal_footer .btn_cancel {
  min-width: 120px;
}

/* Scrollbar styles */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--border-hover);
}

/* Selection mode */
.btn_select {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 10px;
  margin-top: 8px;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  font-size: 0.875rem;
  cursor: pointer;
  transition: 0.2s ease;
}

.btn_select:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--border-hover);
}

.btn_select svg {
  width: 16px;
  height: 16px;
}

.selection_bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
  margin-top: 12px;
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid var(--accent);
  border-radius: 10px;
  font-size: 0.875rem;
}

body[data-theme="light"] .selection_bar {
  background: rgba(26, 115, 232, 0.1);
}

.selection_actions {
  display: flex;
  gap: 8px;
}

.btn_small {
  padding: 6px 12px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  color: var(--text-primary);
  font-size: 0.75rem;
  cursor: pointer;
  transition: 0.2s ease;
}

.btn_small:hover {
  background: var(--bg-hover);
  border-color: var(--border-hover);
}

.btn_small.btn_danger {
  background: rgba(239, 68, 68, 0.15);
  border-color: var(--error);
  color: var(--error);
}

.btn_small.btn_danger:hover {
  background: var(--error);
  color: white;
}

.note_checkbox {
  width: 22px;
  height: 22px;
  min-width: 22px;
  border: 2px solid var(--border-color);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 12px;
  transition: 0.2s ease;
}

.note_checkbox svg {
  width: 14px;
  height: 14px;
  color: white;
  opacity: 0;
}

.note_checkbox.checked {
  background: var(--accent);
  border-color: var(--accent);
}

.note_checkbox.checked svg {
  opacity: 1;
}

.note_item.selected {
  background: rgba(99, 102, 241, 0.15);
  border-color: var(--accent);
}

body[data-theme="light"] .note_item.selected {
  background: rgba(26, 115, 232, 0.1);
}

.selection-mode .note_item {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto auto;
  gap: 0;
  align-items: start;
}

.selection-mode .note_checkbox {
  grid-row: 1 / 4;
  margin-top: 2px;
}

.selection-mode .note_item_title {
  grid-column: 2;
  grid-row: 1;
}

.selection-mode .note_item_preview {
  grid-column: 2;
  grid-row: 2;
}

.selection-mode .note_item_meta {
  grid-column: 2;
  grid-row: 3;
}

.selection-mode .note_pin_badge {
  display: none;
}

.trash_actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.trash_actions .btn_small {
  flex: 1;
}

/* Mobile styles */
@media (max-width: 768px) {
  .app {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    min-width: 100%;
    height: auto;
    max-height: 50vh;
    border-right: none;
    border-bottom: 1px solid var(--border-color);
  }

  .sidebar_header {
    padding: 12px 16px;
  }

  .sidebar_header h1 {
    font-size: 1.125rem;
  }

  .search_box input {
    padding: 8px 12px 8px 36px;
    font-size: 0.8125rem;
  }

  .sort_box {
    margin-top: 8px;
  }

  .btn_new {
    padding: 10px;
    font-size: 0.8125rem;
  }

  .btn_new .shortcut {
    display: none;
  }

  .notes_container {
    padding: 8px;
    max-height: 200px;
  }

  .note_item {
    padding: 10px 12px;
  }

  .note_item_title {
    font-size: 0.875rem;
  }

  .note_item_preview {
    font-size: 0.75rem;
  }

  .note_item_meta {
    font-size: 0.6875rem;
  }

  .sidebar_footer {
    padding: 12px 16px;
  }

  .main {
    flex: 1;
    min-height: 0;
  }

  .toolbar {
    padding: 8px 12px;
    min-height: 50px;
    flex-wrap: wrap;
    gap: 8px;
  }

  .toolbar_group {
    gap: 4px;
  }

  .btn_tool {
    width: 32px;
    height: 32px;
  }

  .btn_tool svg {
    width: 16px;
    height: 16px;
  }

  .importance_btn {
    width: 24px;
    height: 24px;
    font-size: 0.6875rem;
  }

  .btn_delete {
    padding: 6px 10px;
    font-size: 0.75rem;
  }

  .btn_delete span {
    display: none;
  }

  .toolbar_divider {
    height: 20px;
    margin: 0 4px;
  }

  .editor_container {
    padding: 16px;
  }

  .editor_title {
    font-size: 1.5rem;
  }

  .editor_meta {
    flex-direction: column;
    gap: 8px;
    font-size: 0.75rem;
  }

  .editor_content {
    min-height: 200px;
    font-size: 0.9375rem;
  }

  .no_selection svg {
    width: 60px;
    height: 60px;
  }

  .no_selection h2 {
    font-size: 1rem;
  }

  .no_selection p {
    font-size: 0.8125rem;
  }

  .modal {
    width: 95%;
    padding: 20px;
  }

  .modal h3 {
    font-size: 1rem;
  }

  .modal p {
    font-size: 0.8125rem;
  }

  .modal_actions button {
    padding: 10px;
    font-size: 0.8125rem;
  }

  .toast_container {
    bottom: 12px;
    right: 12px;
    left: 12px;
  }

  .toast {
    padding: 12px 14px;
  }

  .toast span {
    font-size: 0.8125rem;
  }

  .selection_bar {
    flex-direction: column;
    gap: 8px;
    padding: 10px;
  }

  .selection_actions {
    width: 100%;
    justify-content: center;
  }

  .btn_small {
    padding: 8px 10px;
    font-size: 0.6875rem;
  }

  .btn_select {
    padding: 8px;
    font-size: 0.8125rem;
  }

  .modal_export {
    max-height: 90vh;
  }

  .export_notes_list {
    max-height: 200px;
  }

  .export_actions {
    flex-direction: column;
  }

  .btn_export_action {
    flex-direction: row;
    padding: 12px;
    gap: 10px;
  }

  .btn_export_action svg {
    width: 20px;
    height: 20px;
  }
}

@media (max-width: 480px) {
  .sidebar {
    max-height: 45vh;
  }

  .sidebar_header {
    padding: 10px 12px;
  }

  .notes_container {
    max-height: 150px;
  }

  .toolbar {
    padding: 6px 10px;
  }

  .editor_container {
    padding: 12px;
  }

  .editor_title {
    font-size: 1.25rem;
  }

  .trash_actions {
    flex-direction: column;
  }
}
