:root {
  --page: #c8d4c3;
  --shell: #f7f7f5;
  --sidebar: #fbfbfa;
  --text: #222624;
  --muted: #6c746f;
  --line: #e6e7e2;
  --accent: #1f2925;
  --shadow: 0 24px 60px rgba(67, 79, 70, 0.25);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--page);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
textarea {
  font: inherit;
}

.app-shell {
  width: min(1040px, calc(100vw - 32px));
  min-height: min(650px, calc(100vh - 64px));
  margin: 48px auto;
  display: grid;
  grid-template-columns: 250px 1fr;
  overflow: hidden;
  background: var(--shell);
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.sidebar {
  display: flex;
  min-height: 100%;
  flex-direction: column;
  gap: 22px;
  padding: 26px 18px;
  background: var(--sidebar);
  border-right: 1px solid var(--line);
}

.sidebar-top,
.content-header,
.modal-header,
.button-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.sidebar h2,
.panel h2,
.modal h2 {
  margin: 0;
  font-size: 18px;
}

.menu-icon {
  color: var(--muted);
  font-weight: 700;
}

.search-box {
  position: relative;
  display: block;
}

.search-box span {
  position: absolute;
  left: 36px;
  top: 50%;
  color: #8a908c;
  font-size: 12px;
  transform: translateY(-50%);
}

.search-box::before {
  content: "Q";
  position: absolute;
  left: 14px;
  top: 50%;
  color: #8a908c;
  font-size: 13px;
  transform: translateY(-50%);
}

.search-box input {
  width: 100%;
  height: 38px;
  padding: 0 12px 0 88px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
}

.nav-group {
  display: grid;
  gap: 6px;
}

.nav-group p,
.tag-box p {
  margin: 0 0 6px;
  color: #535a55;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.nav-group a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 34px;
  padding: 8px 10px;
  color: #3b413d;
  text-decoration: none;
  border-radius: 7px;
  font-size: 13px;
}

.nav-group a.active,
.nav-group a:hover {
  background: #efefed;
}

.nav-group b {
  min-width: 24px;
  padding: 2px 6px;
  background: #fff;
  border-radius: 10px;
  color: #626a65;
  text-align: center;
  font-size: 11px;
}

.tag-box {
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 27px;
  margin: 4px 4px 0 0;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
}

.tag.blue {
  background: #d8eff2;
}

.tag.pink {
  background: #f9d5d8;
}

.tag.neutral {
  background: #eeeeeb;
}

.sidebar-bottom {
  margin-top: auto;
}

.link-button {
  width: 100%;
  min-height: 38px;
  border: 0;
  background: transparent;
  color: #3b413d;
  text-align: left;
  cursor: pointer;
}

.content {
  min-width: 0;
  padding: 28px 34px 42px;
}

.content-header {
  margin-bottom: 30px;
}

h1 {
  margin: 0;
  color: #202523;
  font-size: 38px;
  line-height: 1.05;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.notes-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(150px, 1fr));
  gap: 16px;
}

.note-card,
.add-note {
  min-height: 228px;
  padding: 22px;
  border: 0;
  border-radius: 6px;
  box-shadow: 0 10px 18px rgba(38, 44, 41, 0.06);
}

.note-card {
  position: relative;
  display: flex;
  flex-direction: column;
}

.note-card h2 {
  margin: 0 0 12px;
  font-size: 19px;
  line-height: 1.2;
}

.note-card p {
  margin: 0;
  color: #343b37;
  font-size: 13px;
  line-height: 1.45;
}

.note-card time {
  margin-top: auto;
  padding-top: 18px;
  color: rgba(34, 38, 36, 0.58);
  font-size: 12px;
}

.note-yellow {
  background: #fff3ad;
}

.note-blue {
  background: #cfeef3;
}

.note-pink {
  background: #ffd4d6;
}

.note-orange {
  background: #ffd0a2;
}

.note-gray {
  background: #e8e8e6;
}

.note-actions {
  position: absolute;
  top: 10px;
  right: 10px;
}

.delete-button,
.icon-button {
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.55);
  color: #303733;
  cursor: pointer;
}

.add-note {
  display: grid;
  place-items: center;
  background: #e7e7e5;
  color: #1f2723;
  cursor: pointer;
  font-size: 72px;
  font-weight: 300;
}

.primary-button,
.secondary-button {
  min-height: 42px;
  padding: 0 18px;
  border: 0;
  border-radius: 7px;
  cursor: pointer;
  font-weight: 800;
}

.primary-button {
  background: var(--accent);
  color: #fff;
}

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

.compact {
  min-height: 38px;
}

.form-stack {
  display: grid;
  gap: 14px;
}

.form-stack label {
  display: grid;
  gap: 7px;
  color: #3e4641;
  font-size: 13px;
  font-weight: 800;
}

.form-stack input,
.form-stack textarea {
  width: 100%;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--text);
}

.profile-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.panel {
  padding: 22px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.panel h2 {
  margin-bottom: 18px;
}

.settings-list {
  display: grid;
  gap: 12px;
}

.settings-list div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.modal {
  position: fixed;
  inset: 0;
  display: none;
  place-items: center;
  padding: 20px;
  background: rgba(31, 39, 35, 0.35);
}

.modal[aria-hidden="false"] {
  display: grid;
}

.modal-panel {
  width: min(430px, 100%);
  padding: 22px;
  background: var(--shell);
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.modal-header {
  margin-bottom: 18px;
}

.flash-stack {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

.flash {
  margin: 0;
  padding: 11px 13px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 700;
}

.flash.error {
  background: #ffe0e0;
  color: #8c2222;
}

.flash.success {
  background: #dff3df;
  color: #235a2c;
}

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

.login-shell {
  width: min(430px, 100%);
}

.login-card {
  padding: 34px;
  background: var(--shell);
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.login-card.wide {
  width: min(720px, calc(100vw - 32px));
}

.muted {
  color: var(--muted);
}

pre {
  overflow: auto;
  padding: 14px;
  background: #ededeb;
  border-radius: 8px;
}

@media (max-width: 820px) {
  .app-shell {
    width: min(100vw - 18px, 640px);
    margin: 9px auto;
    grid-template-columns: 1fr;
  }

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

  .notes-grid,
  .profile-grid {
    grid-template-columns: 1fr;
  }

  .content {
    padding: 24px 18px 32px;
  }

  .content-header {
    align-items: flex-start;
    flex-direction: column;
  }

  h1 {
    font-size: 32px;
  }
}
