:root {
    --bg: #F7F6F2;
    --surface: #FFFFFF;
    --brand: #1A3A2A;
    --brand-strong: #10251b;
    --accent: #22C55E;
    --accent-soft: rgba(34, 197, 94, 0.14);
    --text: #23372c;
    --muted: #6D7C72;
    --border: rgba(26, 58, 42, 0.12);
    --shadow: 0 28px 70px rgba(26, 58, 42, 0.08);
}

* {
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    margin: 0;
    font-family: "Manrope", sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(34, 197, 94, 0.18), transparent 28%),
        radial-gradient(circle at top right, rgba(26, 58, 42, 0.14), transparent 26%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.7), rgba(247, 246, 242, 1)),
        var(--bg);
}

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

.app-navbar {
    background: rgba(247, 246, 242, 0.84);
    backdrop-filter: blur(18px);
    border-bottom: 1px solid rgba(26, 58, 42, 0.08);
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 2.8rem;
    height: 2.8rem;
    border-radius: 1rem;
    color: #fff;
    background: linear-gradient(135deg, var(--brand), #28533f);
    box-shadow: 0 14px 30px rgba(26, 58, 42, 0.18);
}

.brand-title {
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: 0.02em;
}

.brand-subtitle {
    font-size: 0.75rem;
    color: var(--muted);
}

.nav-user-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
    min-height: 2.8rem;
    padding: 0.35rem 0.8rem 0.35rem 0.4rem;
    border: 1px solid rgba(26, 58, 42, 0.08);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.78);
    box-shadow: 0 12px 24px rgba(26, 58, 42, 0.06);
}

.nav-user-badge-avatar {
    display: grid;
    place-items: center;
    width: 2rem;
    height: 2rem;
    border-radius: 999px;
    color: #fff;
    font-size: 0.78rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--brand), #28533f);
}

.nav-user-badge-copy {
    display: flex;
    flex-direction: column;
    line-height: 1.05;
}

.nav-user-badge-name {
    font-size: 0.84rem;
    font-weight: 800;
    color: var(--brand);
}

.nav-user-badge-state {
    font-size: 0.72rem;
    color: var(--muted);
}

.app-shell {
    position: relative;
    z-index: 1;
    padding-top: 6.6rem;
    padding-bottom: 2rem;
}

.surface-panel {
    border: 1px solid var(--border);
    border-radius: 1.6rem;
    background: rgba(255, 255, 255, 0.88);
    box-shadow: var(--shadow);
}

.notes-sidebar,
.editor-panel {
    padding: 1.5rem;
}

.notes-sidebar {
    min-height: calc(100vh - 8.5rem);
}

.editor-panel {
    min-height: calc(100vh - 8.5rem);
}

.section-header,
.editor-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.eyebrow {
    margin: 0;
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--muted);
}

.user-card {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 1rem;
    border-radius: 1.15rem;
    background: linear-gradient(135deg, rgba(26, 58, 42, 0.04), rgba(34, 197, 94, 0.08));
    border: 1px solid rgba(26, 58, 42, 0.08);
}

.user-avatar {
    display: grid;
    place-items: center;
    width: 3rem;
    height: 3rem;
    border-radius: 1rem;
    font-weight: 800;
    color: #fff;
    background: linear-gradient(135deg, var(--accent), #149648);
}

.note-list {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.note-item {
    width: 100%;
    border: 1px solid transparent;
    border-radius: 1.2rem;
    padding: 1rem;
    background: #FCFCFA;
    text-align: left;
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.note-item:hover {
    transform: translateY(-1px);
    border-color: rgba(34, 197, 94, 0.24);
    box-shadow: 0 18px 38px rgba(26, 58, 42, 0.08);
}

.note-item.active {
    border-color: rgba(34, 197, 94, 0.35);
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.15), rgba(26, 58, 42, 0.05));
}

.note-item-title {
    margin: 0 0 0.35rem;
    font-size: 0.98rem;
    font-weight: 700;
    color: var(--brand);
}

.note-item-body,
.note-item-date {
    margin: 0;
    font-size: 0.88rem;
    color: var(--muted);
}

.note-item-body {
    display: -webkit-box;
    overflow: hidden;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.empty-state {
    display: grid;
    gap: 0.45rem;
    place-items: center;
    padding: 2rem 1rem;
    text-align: center;
    border: 1px dashed rgba(26, 58, 42, 0.14);
    border-radius: 1.2rem;
    color: var(--muted);
    background: rgba(255, 255, 255, 0.55);
}

.empty-state i {
    font-size: 1.7rem;
    color: var(--brand);
}

.empty-state h2 {
    margin: 0;
    font-size: 1.05rem;
    color: var(--brand);
}

.empty-state p {
    margin: 0;
    max-width: 24rem;
}

.btn-accent,
.btn-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    border-radius: 999px;
    padding-inline: 1rem;
    font-weight: 700;
}

.btn-accent {
    color: #fff;
    border-color: transparent;
    background: linear-gradient(135deg, var(--accent), #18a24c);
    box-shadow: 0 16px 28px rgba(34, 197, 94, 0.22);
}

.btn-accent:hover,
.btn-accent:focus {
    color: #fff;
    background: linear-gradient(135deg, #1fb557, #148c42);
}

.btn-brand {
    color: #fff;
    border-color: transparent;
    background: linear-gradient(135deg, var(--brand), #214534);
}

.btn-brand:hover,
.btn-brand:focus {
    color: #fff;
    background: linear-gradient(135deg, var(--brand-strong), #1A3A2A);
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    min-height: 2.4rem;
    padding: 0.45rem 0.85rem;
    border: 1px solid rgba(26, 58, 42, 0.1);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.75);
    color: var(--brand);
    font-size: 0.9rem;
    font-weight: 700;
}

.status-pill.is-success {
    background: rgba(34, 197, 94, 0.12);
    color: #106e34;
}

.status-pill.is-danger {
    background: rgba(220, 38, 38, 0.08);
    color: #b42318;
}

.form-control {
    border-radius: 1rem;
    border-color: rgba(26, 58, 42, 0.12);
    padding: 0.9rem 1rem;
    color: var(--text);
    box-shadow: none;
}

.form-control:focus {
    border-color: rgba(34, 197, 94, 0.55);
    box-shadow: 0 0 0 0.2rem rgba(34, 197, 94, 0.12);
}

.note-textarea {
    min-height: 26rem;
    resize: vertical;
}

.editor-footer {
    padding-top: 0.35rem;
}

.save-status {
    font-weight: 700;
    color: var(--brand);
}

.flash-message {
    margin-bottom: 1rem;
    padding: 0.95rem 1rem;
    border-radius: 1rem;
    font-weight: 600;
}

.flash-message.is-success {
    color: #0f6d31;
    background: rgba(34, 197, 94, 0.12);
}

.flash-message.is-danger {
    color: #b42318;
    background: rgba(220, 38, 38, 0.08);
}

.flash-message.is-info {
    color: var(--brand);
    background: rgba(26, 58, 42, 0.06);
}

@media (max-width: 1199.98px) {
    .notes-sidebar,
    .editor-panel {
        min-height: auto;
    }
}

@media (max-width: 767.98px) {
    .app-shell {
        padding-top: 7rem;
    }

    .brand-subtitle {
        display: none;
    }

    .section-header,
    .editor-topbar {
        flex-direction: column;
        align-items: stretch;
    }

    .note-textarea {
        min-height: 20rem;
    }

    .status-pill {
        display: none;
    }

    .nav-user-badge {
        display: none;
    }
}
