* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}
body {
    background-color: #0f172a;
    color: #f8fafc;
    height: 100vh;
    overflow-x: hidden;
}
.app-layout {
    display: flex;
    min-height: 100vh;
}
.sidebar {
    width: 200px;
    background-color: #1e293b;
    border-right: 1px solid #334155;
    display: flex;
    flex-direction: column;
    padding: 1rem 0.5rem;
    transition: all 0.3s ease;
    white-space: nowrap;
    overflow: hidden;
    z-index: 10;
}
.sidebar.collapsed {
    width: 65px;
    padding: 1rem 0.3rem;
}
.sidebar.collapsed .nav-menu {
    display: none;
}
.toggle-btn {
    background: #334155;
    border: 1px solid #475569;
    font-size: 0.75rem;
    font-weight: bold;
    cursor: pointer;
    padding: 0.5rem 0.75rem;
    align-self: center;
    color: #f8fafc;
    border-radius: 6px;
    width: 100%;
}
.toggle-btn:hover { background-color: #475569; }
.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 1rem;
}
.nav-item {
    display: flex;
    align-items: center;
    background: none;
    border: none;
    padding: 0.75rem 0.85rem;
    border-radius: 8px;
    cursor: pointer;
    color: #94a3b8;
    font-size: 0.85rem;
    font-weight: 600;
    width: 100%;
    text-align: left;
}
.nav-item:hover { background-color: #334155; color: #f8fafc; }
.nav-item.active { background-color: #2563eb; color: #ffffff; }
.sidebar-divider {
    height: 1px;
    background: #334155;
    margin: 0.5rem 0;
}
.main-content {
    flex: 1;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow-y: auto;
}
.top-bar {
    width: 100%;
    max-width: 1000px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}
h1 { color: #f8fafc; font-size: 1.8rem; }
.search-input {
    background: #1e293b;
    border: 1px solid #334155;
    color: #f8fafc;
    padding: 0.6rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    width: 250px;
}
.search-input:focus { outline: none; 
    border-color: #2563eb; }
.action-card {
    width: 100%;
    max-width: 500px;
    height: 100px;
    background: #1e293b;
    border: 2px dashed #334155;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2.5rem;
}
.action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0.75rem;
    border-radius: 8px;
    transition: background 0.2s ease, transform 0.1s ease;
    width: 80%;
}
.action-btn:hover { background-color: #334155;
     transform: translateY(-2px); }
.action-btn .icon { font-size: 2.2rem; 
    line-height: 1;
     color: #3b82f6; 
     font-weight: 300; }
.action-btn .label { margin-top: 0.2rem; 
    font-size: 0.85rem; 
    font-weight: 600; 
    color: #94a3b8; 
    text-transform: uppercase; }
.notes-grid {
    width: 100%;
    max-width: 1000px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.25rem;
}
.note-card {
    background: #1e293b;
    aspect-ratio: 1 / 1;
    padding: 1.25rem;
    border-radius: 10px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
    word-break: break-word;
    border: 1px solid #334155;
    position: relative;
}
.note-card.pinned { border: 1px solid #3b82f6; }
.note-card.protected-note { border: 2px solid #f59e0b; }
.pin-badge {
    position: absolute;
    top: 5px; 
    right: 8px;
    font-size: 0.65rem; 
    background: #3b82f6; 
    color: white;
    padding: 2px 5px; 
    border-radius: 4px; 
    font-weight: bold; 
    text-transform: uppercase;
}
.protected-badge {
    position: absolute;
    top: 5px; 
    right: 8px;
    font-size: 0.65rem; 
    background: #f59e0b; 
    color: #0f172a;
    padding: 2px 5px; 
    border-radius: 4px; 
    font-weight: bold; 
    text-transform: uppercase;
}
.note-card h3 {
    font-size: 1rem; 
    margin-bottom: 0.5rem; 
    color: #f8fafc;
    white-space: nowrap; 
    overflow: hidden; 
    text-overflow: ellipsis; 
    padding-right: 50px;
}
.note-body {
    color: #cbd5e1; 
    font-size: 0.85rem; 
    line-height: 1.4;
    display: -webkit-box; 
    -webkit-line-clamp: 5; 
    -webkit-box-orient: vertical; 
    overflow: hidden;
}
.note-card mark { background-color: #facc15; 
    color: #000000; 
    padding: 0 2px; 
    border-radius: 2px; }
.card-checklist-items { list-style: none; 
    font-size: 0.85rem; 
    color: #cbd5e1; }
.card-checklist-items li { display: flex;
     align-items: center;
      gap: 0.4rem;
       margin-bottom: 0.2rem; }
.card-checklist-items li.done { text-decoration: line-through; 
    opacity: 0.6; }
.card-actions { display: flex; 
    justify-content: flex-end; 
    gap: 0.3rem; 
    margin-top: 0.5rem; }
.card-btn {
    background: #334155; 
    border: none; 
    font-size: 0.65rem; 
    font-weight: 700;
    text-transform: uppercase; 
    cursor: pointer; 
    padding: 0.3rem 0.4rem; 
    border-radius: 4px; 
    color: #cbd5e1;
}
.card-btn:hover { background-color: #475569; 
    color: #ffffff; }
.modal-overlay {
    display: none; 
    position: fixed; 
    top: 0; 
    left: 0;
    width: 100%; 
    height: 100%; 
    background: rgba(0, 0, 0, 0.75);
    justify-content: center; 
    align-items: center; 
    z-index: 100;
}
.modal-content {
    background: #1e293b; 
    padding: 1.5rem; 
    border-radius: 10px;
    width: 90%; 
    max-width: 450px; 
    display: flex; 
    flex-direction: column; 
    gap: 1rem; 
    border: 1px solid #334155;
}
.modal-content.modal-large { max-width: 800px; 
    height: 80vh; }
.modal-header { display: flex; 
    justify-content: space-between; 
    align-items: center; }
.modal-content input[type="text"] {
    width: 100%; 
    padding: 0.75rem; 
    background: #0f172a;
    border: 1px solid #334155; 
    color: #f8fafc; 
    border-radius: 6px; 
    font-size: 0.95rem;
}
.editor-toolbar { display: flex; 
    gap: 0.4rem; 
    background: #0f172a; 
    padding: 0.4rem; 
    border-radius: 6px; 
    border: 1px solid #334155; }
.tool-btn {
    background: #1e293b; 
    border: 1px solid #334155; 
    color: #f8fafc;
    padding: 0.3rem 0.6rem; 
    border-radius: 4px; 
    cursor: pointer; 
    font-size: 0.85rem; 
    font-weight: bold;
}
.tool-btn:hover { background: #334155; }
.highlight-tool { background: #facc15; 
    color: #0f172a; 
    border: none; }
#editorContainer { flex: 1; 
    display: flex; 
    flex-direction: column; 
    overflow: hidden; }
#noteTextEditor {
    flex: 1; 
    background: #0f172a; 
    border: 1px solid #334155; 
    color: #f8fafc;
    padding: 1rem; 
    border-radius: 6px; 
    overflow-y: auto; 
    outline: none; 
    font-size: 0.95rem; 
    line-height: 1.5;
}
#noteTextEditor[data-placeholder]:empty:before { content: attr(data-placeholder); 
    color: #64748b; }
#noteTextEditor mark { background-color: #facc15; 
    color: #000000; 
    padding: 0 2px; 
    border-radius: 2px; }
.checklist-builder { display: flex; 
    flex-direction: column; 
    gap: 1rem; 
    height: 100%; }
.checklist-input-group { display: flex; 
    gap: 0.5rem; }
.checklist-input-group button { background: #2563eb; 
    color: white; 
    border: none; 
    padding: 0 1rem; 
    border-radius: 6px; 
    cursor: pointer; }
#checklistItemsList { list-style: none; 
    overflow-y: auto; 
    max-height: 100%; 
    display: flex; 
    flex-direction: column; 
    gap: 0.5rem; }
#checklistItemsList li {
    display: flex; 
    align-items: center; 
    gap: 0.5rem; 
    background: #0f172a;
    padding: 0.5rem 0.75rem; 
    border-radius: 6px; 
    border: 1px solid #334155;
}

#checklistItemsList li.done span { text-decoration: line-through; 
    opacity: 0.5; }

.modal-tools { display: flex; 
    align-items: center; 
    gap: 1rem;
    font-size: 0.8rem; 
    color: #94a3b8; }

.color-picker { display: flex; 
    align-items: center; 
    gap: 0.5rem; }
.color-picker input { background: none; 
    border: none; 
    cursor: pointer; 
    width: 25px; 
    height: 25px; }

.modal-actions { display: flex; 
    justify-content: flex-end; 
    gap: 0.5rem; }
.modal-actions button { padding: 0.5rem 1rem; 
    border: none; 
    border-radius: 6px; 
    cursor: pointer; 
    font-weight: 600; }

#saveBtn { background: #2563eb; 
    color: white; }
#cancelBtn { background: #334155; 
    color: #cbd5e1; }

.type-selector { text-align: center; }
.type-options { display: flex; 
    flex-direction: column; 
    gap: 0.75rem; 
    margin: 1rem 0; }
.type-btn {
    background: #0f172a; 
    border: 1px solid #334155; 
    padding: 1rem;
    border-radius: 8px; 
    cursor: pointer; 
    text-align: left; 
    display: flex; 
    flex-direction: column; 
    gap: 0.25rem;
}
.type-btn:hover { border-color: #2563eb; 
    background: #1e293b; }
.type-title { font-weight: bold; 
    color: #f8fafc; }
.type-desc { font-size: 0.8rem; 
    color: #94a3b8; }
.close-type-btn { background: none; 
    border: none; 
    color: #94a3b8; 
    cursor: pointer; 
    text-decoration: underline; 
}