body {
    background: #f6f8fb;
    color: #182230;
    -webkit-font-smoothing: antialiased;
}

.app-shell { display: flex; }
.app-sidebar { position: fixed; inset: 0 auto 0 0; width: 260px; z-index: 10; }
.app-main { width: 100%; margin-left: 260px; }
.app-content { max-width: 1280px; padding: 2.5rem; }
.brand-mark { width: 38px; height: 38px; }
.app-nav-link { display: flex; align-items: center; gap: .75rem; width: 100%; padding: .7rem .75rem; border-radius: .65rem; color: #5d6877; font-weight: 500; text-decoration: none; transition: background .15s, color .15s; }
.app-nav-link:hover, .app-nav-link.active { color: #3659d6; background: #eef1ff; }
.sidebar-notes { min-height: 0; }
.sidebar-note { flex: none; padding: .45rem .75rem; border-radius: .5rem; color: #687383; font-size: .9rem; }
.sidebar-note:hover { color: #3659d6; background: #f1f3f6; }
.home-card, .stat-card, .note-card, .note-detail { border: 1px solid #e4e8ef; border-radius: 1rem; background: #fff; }
.home-card { padding: 1.75rem; color: #182230; transition: transform .15s, box-shadow .15s; }
.home-card:hover { transform: translateY(-3px); box-shadow: 0 .5rem 1.5rem rgba(40, 55, 85, .1); }
.home-card-primary { color: #fff; background: #435dde; border-color: #435dde; }
.home-card-primary:hover { color: #fff; box-shadow: 0 .75rem 1.75rem rgba(67, 93, 222, .25); }
.stat-card { padding: 1.25rem; }
.note-card { transition: transform .15s, box-shadow .15s; }
.note-card:hover { transform: translateY(-2px); box-shadow: 0 .5rem 1.25rem rgba(40, 55, 85, .1) !important; }
.note-excerpt { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; white-space: pre-line; }
.empty-state { padding: 3rem 1rem; border: 1px dashed #b8c1ce; border-radius: 1rem; background: #fff; color: #687383; text-align: center; }
.attachment-row { color: #3659d6; background: #f4f6f9; }
.attachment-row:hover { background: #e9edff; }
.markdown-body p { margin: 1rem 0; }
.markdown-body h1, .markdown-body h2, .markdown-body h3 { margin: 1.5rem 0 .75rem; font-weight: 700; }
.markdown-body pre { overflow: auto; padding: 1rem; border-radius: .5rem; background: #e9edf3; }
.markdown-body code { padding: .15rem .3rem; border-radius: .25rem; background: #e9edf3; }
.markdown-body a { color: #3659d6; text-decoration: underline; }
.auth-page { min-height: 100vh; background: #f6f8fb; }
.auth-wrap { width: 100%; max-width: 440px; margin: 2rem auto 0; }
.auth-card { border: 1px solid #e4e8ef; border-radius: 1rem; background: #fff; }
.letter-spacing { letter-spacing: .12em; }

.theme-dark body, .theme-dark .auth-page { background: #121722; color: #e9edf5; }
.theme-dark .app-sidebar, .theme-dark .app-main > header, .theme-dark .home-card, .theme-dark .stat-card, .theme-dark .note-card, .theme-dark .note-detail, .theme-dark .auth-card, .theme-dark .empty-state { color: #e9edf5; background: #1b2230 !important; border-color: #303b4d; }
.theme-dark .text-body, .theme-dark .home-card:not(.home-card-primary) h2, .theme-dark .home-card:not(.home-card-primary) { color: #e9edf5 !important; }
.theme-dark .text-secondary, .theme-dark .form-text { color: #aab5c6 !important; }
.theme-dark .app-nav-link, .theme-dark .sidebar-note { color: #aab5c6; }
.theme-dark .app-nav-link:hover, .theme-dark .app-nav-link.active, .theme-dark .sidebar-note:hover { color: #b9c5ff; background: #29334a; }
.theme-dark .form-control, .theme-dark .form-select { color: #e9edf5; background-color: #202a3a; border-color: #445167; }
.theme-dark .bg-light, .theme-dark .attachment-row { color: #e9edf5 !important; background-color: #263143 !important; }
.theme-dark .attachment-row:hover { background: #303d55 !important; }
.theme-dark .markdown-body pre, .theme-dark .markdown-body code { background: #263143; }

@media (max-width: 767.98px) {
    .app-main { margin-left: 0; }
    .app-content { padding: 1.25rem; }
}
