* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: 'Segoe UI', system-ui, sans-serif;
    background: #0f172a;
    color: #e2e8f0;
    min-height: 100vh;
}
.container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}
.auth-box {
    background: #1e293b;
    padding: 40px;
    border-radius: 16px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}
.logo {
    font-size: 28px;
    font-weight: 800;
    text-align: center;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.auth-box h2 {
    text-align: center;
    margin-bottom: 24px;
    font-weight: 400;
    color: #94a3b8;
}
input, textarea {
    width: 100%;
    padding: 12px 16px;
    margin-bottom: 12px;
    border: 1px solid #334155;
    border-radius: 8px;
    background: #0f172a;
    color: #e2e8f0;
    font-size: 15px;
    outline: none;
    transition: border-color 0.2s;
}
input:focus, textarea:focus {
    border-color: #667eea;
}
button {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 8px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}
button:hover { opacity: 0.9; }
.link { text-align: center; margin-top: 16px; color: #94a3b8; }
.link a { color: #667eea; text-decoration: none; }
#msg { text-align: center; margin-top: 12px; font-size: 14px; }
#msg:empty { display: none; }

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    background: #1e293b;
    border-bottom: 1px solid #334155;
}
.nav-right { display: flex; align-items: center; gap: 16px; }
.nav-right button { width: auto; padding: 8px 20px; font-size: 13px; }
#userDisplay { color: #94a3b8; font-size: 14px; }

.app-container { display: flex; height: calc(100vh - 65px); }
.sidebar {
    width: 300px;
    background: #1e293b;
    border-right: 1px solid #334155;
    display: flex;
    flex-direction: column;
}
.btn-new {
    margin: 16px;
    width: calc(100% - 32px);
}
.note-list {
    flex: 1;
    overflow-y: auto;
    padding: 0 16px 16px;
}
.note-item {
    padding: 14px;
    margin-bottom: 8px;
    background: #0f172a;
    border-radius: 10px;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.2s;
}
.note-item:hover, .note-item.active {
    border-color: #667eea;
    background: #162032;
}
.note-item h4 {
    font-size: 14px;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.note-item small {
    font-size: 11px;
    color: #64748b;
}
.editor {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 24px;
    background: #0f172a;
}
#noteTitle {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 16px;
    background: transparent;
    border: none;
    border-bottom: 1px solid #334155;
    border-radius: 0;
    padding: 8px 0;
}
#noteContent {
    flex: 1;
    resize: none;
    background: transparent;
    border: none;
    font-size: 15px;
    line-height: 1.7;
    font-family: inherit;
}
.actions {
    display: flex;
    gap: 12px;
    margin-top: 16px;
}
.actions button { width: auto; padding: 10px 28px; }
.btn-del { background: #ef4444 !important; }

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #64748b;
}
