:root {
    --bg: #c7d2c0;
    --panel: #f7f7f5;
    --sidebar: #f1f2ef;
    --line: #e7e6df;
    --text: #242824;
    --muted: #72786f;
    --shadow: 0 22px 55px rgba(58, 70, 56, 0.22);
    --yellow: #fff4ad;
    --blue: #cae8ec;
    --pink: #fbd1d2;
    --orange: #ffd1a1;
    --gray: #e9e9e7;
    --green: #d7e7d2;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    margin: 0;
    background:
        radial-gradient(circle at 20% 10%, rgba(255, 255, 255, 0.3), transparent 26%),
        var(--bg);
    color: var(--text);
}

button,
input,
textarea,
select {
    font: inherit;
}

button {
    cursor: pointer;
}

.login-page,
.app-shell {
    min-height: 100vh;
    padding: 36px;
}

.login-page {
    display: grid;
    place-items: center;
}

.login-card {
    width: min(440px, 100%);
    padding: 34px;
    background: rgba(247, 247, 245, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.55);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.login-card h1,
.page-title {
    margin: 0 0 10px;
    font-size: clamp(2rem, 4vw, 3.2rem);
    line-height: 1;
    letter-spacing: 0;
}

.login-card p,
.muted {
    color: var(--muted);
}

.form-grid {
    display: grid;
    gap: 16px;
}

.form-row {
    display: grid;
    gap: 7px;
}

label {
    font-size: 0.88rem;
    font-weight: 700;
}

input,
textarea,
select {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--text);
    outline: none;
    padding: 12px 13px;
}

textarea {
    min-height: 112px;
    resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
    border-color: #9fb19c;
    box-shadow: 0 0 0 4px rgba(159, 177, 156, 0.18);
}

.button,
.icon-button,
.sidebar-link,
.danger-link {
    border: 0;
    border-radius: 8px;
    text-decoration: none;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 18px;
    background: #242824;
    color: #fff;
    font-weight: 800;
}

.button.secondary {
    background: #ecece8;
    color: var(--text);
}

.button.danger {
    background: #8f2f34;
}

.flash-stack {
    display: grid;
    gap: 10px;
    margin: 18px 0;
}

.flash {
    border-radius: 8px;
    padding: 12px 14px;
    font-weight: 700;
}

.flash.error {
    background: #fee3e3;
    color: #8f2f34;
}

.flash.success {
    background: #dff0da;
    color: #365f2d;
}

.board {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    width: min(1180px, 100%);
    min-height: min(760px, calc(100vh - 72px));
    margin: 0 auto;
    overflow: hidden;
    background: rgba(247, 247, 245, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.55);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.sidebar {
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding: 28px;
    background: var(--sidebar);
    border-right: 1px solid var(--line);
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sidebar-header h2 {
    margin: 0;
    font-size: 1.35rem;
}

.hamburger {
    display: grid;
    gap: 4px;
}

.hamburger span {
    width: 16px;
    height: 2px;
    background: var(--muted);
}

.search-field {
    position: relative;
}

.search-field span {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted);
}

.search-field input {
    padding-left: 36px;
}

.sidebar-group {
    display: grid;
    gap: 8px;
}

.sidebar-title {
    margin: 0 0 6px;
    color: #535850;
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.sidebar-link {
    display: grid;
    grid-template-columns: 22px 1fr auto;
    align-items: center;
    min-height: 40px;
    padding: 0 10px;
    color: var(--text);
    font-weight: 700;
}

.sidebar-link.active,
.sidebar-link:hover {
    background: #e9eae6;
}

.count {
    min-width: 26px;
    padding: 2px 7px;
    border-radius: 8px;
    background: #fff;
    color: var(--muted);
    font-size: 0.78rem;
    text-align: center;
}

.tag-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag {
    border-radius: 7px;
    padding: 8px 12px;
    background: var(--gray);
    font-size: 0.82rem;
    font-weight: 800;
}

.tag.blue {
    background: var(--blue);
}

.tag.pink {
    background: var(--pink);
}

.sidebar-footer {
    display: grid;
    gap: 8px;
    margin-top: auto;
}

.main {
    min-width: 0;
    padding: 34px 36px 46px;
}

.main-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 28px;
}

.main-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.tasks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 18px;
}

.sticky-note,
.add-note {
    min-height: 230px;
    border: 0;
    border-radius: 8px;
    box-shadow: 0 10px 18px rgba(42, 45, 39, 0.08);
}

.sticky-note {
    display: flex;
    flex-direction: column;
    padding: 22px;
}

.sticky-note.yellow {
    background: var(--yellow);
}

.sticky-note.blue {
    background: var(--blue);
}

.sticky-note.pink {
    background: var(--pink);
}

.sticky-note.orange {
    background: var(--orange);
}

.sticky-note.gray {
    background: var(--gray);
}

.sticky-note h3 {
    margin: 0 0 12px;
    font-size: 1.26rem;
}

.sticky-note p {
    margin: 0;
    color: #3f433d;
    line-height: 1.45;
    white-space: pre-wrap;
}

.note-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: auto;
    padding-top: 18px;
    color: #5c6258;
    font-size: 0.8rem;
}

.danger-link {
    padding: 7px 9px;
    background: rgba(255, 255, 255, 0.45);
    color: #7a2528;
    font-weight: 800;
}

.add-note {
    display: grid;
    place-items: center;
    background: var(--gray);
    color: var(--text);
}

.add-note span {
    font-size: 4.6rem;
    font-weight: 300;
    line-height: 1;
}

.panel {
    width: min(780px, 100%);
    padding: 24px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.panel + .panel {
    margin-top: 18px;
}

.panel h2 {
    margin: 0 0 18px;
}

.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 4px;
}

.color-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.color-options label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}

.swatch {
    width: 18px;
    height: 18px;
    border-radius: 5px;
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.swatch.yellow {
    background: var(--yellow);
}

.swatch.blue {
    background: var(--blue);
}

.swatch.pink {
    background: var(--pink);
}

.swatch.orange {
    background: var(--orange);
}

.swatch.gray {
    background: var(--gray);
}

.empty-state {
    padding: 28px;
    border: 1px dashed #c9cbc3;
    border-radius: 8px;
    color: var(--muted);
}

@media (max-width: 820px) {
    .login-page,
    .app-shell {
        padding: 14px;
    }

    .board {
        grid-template-columns: 1fr;
    }

    .sidebar {
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

    .main {
        padding: 24px 18px 30px;
    }

    .main-header {
        display: grid;
    }

    .tasks-grid {
        grid-template-columns: 1fr;
    }
}
