:root {
    --bg: #c7d3bf;
    --shell: #f7f7f5;
    --sidebar: #f4f5f2;
    --line: #e7e8e2;
    --text: #242826;
    --muted: #767d75;
    --shadow: 0 24px 70px rgba(44, 62, 48, .22);
    --radius: 22px;
}
* { box-sizing: border-box; }
body {
    margin: 0;
    min-height: 100vh;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--text);
    background: radial-gradient(circle at 25% 20%, #d8e2d2 0, var(--bg) 45%, #b5c3af 100%);
}
.app-shell {
    width: min(1180px, calc(100vw - 38px));
    min-height: min(760px, calc(100vh - 56px));
    margin: 28px auto;
    display: grid;
    grid-template-columns: 270px 1fr;
    background: var(--shell);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}
.sidebar { padding: 28px 20px; background: rgba(248,249,246,.84); border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 22px; }
.menu-head { display: flex; align-items: center; justify-content: space-between; }
.menu-head h2 { margin: 0; font-size: 22px; }
.search-box { padding: 13px 14px; color: var(--muted); border-radius: 12px; background: #fff; font-size: 14px; box-shadow: inset 0 0 0 1px #eceee8; }
.nav-label { margin: 10px 0 8px; color: #8d948a; font-size: 12px; font-weight: 800; letter-spacing: .08em; }
.nav-item { display: flex; gap: 10px; align-items: center; padding: 12px 13px; margin: 3px 0; color: #596057; text-decoration: none; border-radius: 11px; font-weight: 700; }
.nav-item.active, .nav-item:hover { background: #e9ebe6; color: #202420; }
.user-chip { margin-top: auto; display: flex; gap: 12px; align-items: center; padding: 12px; background: #fff; border-radius: 16px; }
.user-chip span { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; background: #fff0b8; font-weight: 900; }
.user-chip small { display: block; color: var(--muted); }
.logout-form { margin: 0; }
.main-panel { padding: 28px 34px 40px; overflow-y: auto; }
.page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 30px; }
h1 { font-size: clamp(34px, 5vw, 48px); line-height: .95; margin: 0 0 9px; letter-spacing: -0.05em; }
h2 { margin: 0 0 18px; }
p { line-height: 1.5; }
.page-header p { margin: 0; color: var(--muted); }
.task-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 22px; align-items: stretch; }
.note { position: relative; min-height: 220px; padding: 52px 24px 24px; border-radius: 7px; box-shadow: 0 12px 26px rgba(32, 38, 34, .08); transition: transform .18s ease, box-shadow .18s ease; }
.note:hover { transform: translateY(-3px); box-shadow: 0 18px 30px rgba(32, 38, 34, .12); }
.note h3 { margin: 0 0 12px; font-size: 21px; }
.note p { margin: 0 0 18px; white-space: normal; }
.note small { display: block; margin-top: 16px; color: rgba(32,38,34,.62); font-weight: 700; font-size: 12px; }
.note.yellow { background: #fff4aa; }
.note.blue { background: #cbeef2; }
.note.pink { background: #ffd6d6; }
.note.orange { background: #ffd4a4; }
.note.gray { background: #e9e9e7; }
.note.green { background: #c9f2d0; }
.note.purple { background: #e2d4ff; }
.note.red { background: #ffb8ad; }
.note.teal { background: #b9f3e4; }
.note.lavender { background: #eee0ff; }
.note.peach { background: #ffd9c2; }
.note.lime { background: #e5f8a8; }
.task-menu { position: absolute; top: 12px; left: 12px; z-index: 3; }
.task-menu summary { width: 34px; height: 34px; display: grid; place-items: center; list-style: none; border-radius: 12px; background: rgba(255,255,255,.62); cursor: pointer; font-size: 26px; line-height: 1; font-weight: 900; }
.task-menu summary::-webkit-details-marker { display: none; }
.task-menu-panel { position: absolute; top: 40px; left: 0; min-width: 150px; padding: 8px; border-radius: 14px; background: rgba(255,255,255,.96); box-shadow: 0 14px 32px rgba(32,38,34,.18); display: grid; gap: 5px; }
.task-menu-panel form { margin: 0; }
.task-menu-panel button { width: 100%; border: 0; border-radius: 10px; background: transparent; padding: 9px 10px; text-align: left; cursor: pointer; font: inherit; font-weight: 800; color: #30362f; }
.task-menu-panel button:hover { background: #f0f1ec; }
.task-menu-panel .danger-option { color: #9b2921; }
.add-note { display: grid; place-items: center; gap: 8px; text-align: center; background: #e9e9e7; color: #262a27; }
.add-note button { width: 78px; height: 78px; border: 0; background: transparent; font-size: 64px; line-height: 1; cursor: pointer; }
.add-note span { font-weight: 800; color: var(--muted); }
.checklist { margin-top: 18px; padding-top: 14px; border-top: 1px solid rgba(32,38,34,.12); }
.checklist-head { display: flex; justify-content: space-between; gap: 10px; align-items: center; margin-bottom: 10px; font-size: 13px; }
.checklist-head span { color: rgba(32,38,34,.64); font-weight: 800; }
.checklist-items { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.checklist-items li { display: grid; grid-template-columns: auto 1fr; gap: 8px; align-items: start; font-size: 14px; }
.checklist-items li.done span { text-decoration: line-through; opacity: .62; }
.checklist-items form { margin: 0; }
.checklist-items button { border: 0; background: transparent; padding: 0; cursor: pointer; font-size: 17px; line-height: 1; }
.empty-checklist { margin: 0 0 10px; color: rgba(32,38,34,.64); font-size: 13px; font-weight: 700; }
.add-item-form { display: grid; grid-template-columns: 1fr 38px; gap: 8px; margin-top: 12px; }
.add-item-form input { padding: 9px 10px; border-radius: 10px; background: rgba(255,255,255,.72); font-size: 13px; }
.add-item-form button { border: 0; border-radius: 10px; background: rgba(32,37,31,.86); color: #fff; font-size: 20px; font-weight: 900; cursor: pointer; }
.kanban-board { display: grid; grid-template-columns: repeat(3, minmax(220px, 1fr)); gap: 20px; align-items: start; }
.kanban-column { min-height: 520px; padding: 16px; border-radius: 20px; background: rgba(255,255,255,.58); border: 1px solid var(--line); }
.kanban-column > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.kanban-column h2 { margin: 0; font-size: 20px; }
.kanban-column > header span { min-width: 32px; height: 32px; display: grid; place-items: center; border-radius: 999px; background: #20251f; color: #fff; font-weight: 900; }
.kanban-list { display: grid; gap: 14px; }
.kanban-card { padding: 16px; border-radius: 15px; box-shadow: 0 10px 24px rgba(32, 38, 34, .08); }
.kanban-card h3 { margin: 8px 0 8px; font-size: 17px; }
.kanban-card p { margin: 0 0 10px; font-size: 14px; }
.kanban-type { display: inline-flex; padding: 5px 9px; border-radius: 999px; background: rgba(255,255,255,.68); color: rgba(32,38,34,.72); font-size: 12px; font-weight: 900; }
.kanban-parent { color: rgba(32,38,34,.64); font-weight: 800; }
.kanban-move-form { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: end; margin-top: 12px; }
.kanban-move-form label { gap: 5px; font-size: 12px; }
.kanban-move-form select { padding: 9px 10px; border-radius: 10px; background: rgba(255,255,255,.78); font-size: 13px; }
.kanban-move-form button { border: 0; border-radius: 10px; padding: 9px 10px; background: #20251f; color: white; font-weight: 900; cursor: pointer; }
.kanban-empty { margin: 20px 4px; color: var(--muted); font-weight: 800; }
.edit-task-panel { display: none; margin-top: 18px; padding-top: 16px; border-top: 1px solid rgba(32,38,34,.16); }
.edit-task-panel.open { display: block; }
.edit-task-panel h4 { margin: 0 0 12px; font-size: 16px; }
.edit-task-form { display: grid; grid-template-columns: 1fr 150px; gap: 12px; }
.edit-task-form input, .edit-task-form textarea, .edit-task-form select { padding: 10px 11px; border-radius: 10px; background: rgba(255,255,255,.78); font-size: 14px; }
.edit-items { display: grid; gap: 9px; }
.edit-item-row { display: grid; gap: 6px; }
.drawer-form, .panel-card { margin-top: 28px; background: rgba(255,255,255,.72); border: 1px solid var(--line); border-radius: 18px; padding: 24px; }
.drawer-form { display: none; }
.drawer-form.open { display: block; }
.form-stack, .form-grid { display: grid; gap: 16px; }
.form-grid { grid-template-columns: 1fr 180px; }
.full { grid-column: 1 / -1; }
label { display: grid; gap: 8px; font-weight: 800; color: #414740; }
input, textarea, select { width: 100%; border: 1px solid #dde1d8; border-radius: 12px; padding: 13px 14px; background: #fff; font: inherit; color: var(--text); }
textarea { resize: vertical; }
.primary-button, .ghost-button { border: 0; border-radius: 12px; padding: 13px 17px; font-weight: 900; cursor: pointer; font: inherit; }
.primary-button { background: #20251f; color: white; }
.ghost-button { background: #eceee8; color: #30362f; }
.form-actions { display: flex; gap: 10px; }
.alert { padding: 13px 16px; border-radius: 13px; margin-bottom: 16px; font-weight: 800; }
.alert.success { background: #dff5dd; color: #1f6b2a; }
.alert.error { background: #ffe1df; color: #9b2921; }
.profile-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.login-body { display: grid; place-items: center; padding: 24px; }
.login-card { width: min(430px, 100%); background: rgba(255,255,255,.86); border-radius: 24px; padding: 34px; box-shadow: var(--shadow); }
.brand-badge { width: 58px; height: 58px; display: grid; place-items: center; border-radius: 18px; background: #fff0ad; font-size: 28px; margin-bottom: 18px; }
.login-card h1 { font-size: 42px; }
.login-card p { color: var(--muted); margin-top: 0; }
.demo-users { margin-top: 20px; padding: 14px; border-radius: 14px; background: #f1f2ed; color: #596057; line-height: 1.5; }
@media (max-width: 820px) {
    .app-shell { grid-template-columns: 1fr; width: min(100vw - 20px, 680px); margin: 10px auto; }
    .sidebar { border-right: 0; border-bottom: 1px solid var(--line); }
    .main-panel { padding: 24px 18px 30px; }
    .profile-grid, .form-grid { grid-template-columns: 1fr; }
    .task-grid { grid-template-columns: 1fr; }
    .kanban-board { grid-template-columns: 1fr; }
    .edit-task-form { grid-template-columns: 1fr; }
}

@media print {
    body.print-mode { background: #fff; }
    body.print-mode .sidebar,
    body.print-mode .page-header,
    body.print-mode .alert,
    body.print-mode .add-note,
    body.print-mode .drawer-form,
    body.print-mode .task-menu,
    body.print-mode .add-item-form,
    body.print-mode .edit-task-panel,
    body.print-mode .note:not(.print-selected) { display: none !important; }
    body.print-mode .app-shell,
    body.print-mode .main-panel,
    body.print-mode .task-grid { display: block; width: auto; min-height: 0; margin: 0; padding: 0; box-shadow: none; background: #fff; }
    body.print-mode .note.print-selected { display: block; break-inside: avoid; box-shadow: none; border: 1px solid #ddd; padding: 28px; color: #111; }
}
