* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  width: 100%;
  min-height: 100%;
}

body {
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f5f6f8;
  color: #17181a;
}

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

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: 100vh;
  background: #fff;
}

.sidebar {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding: 18px 14px;
  background: #f8f8f9;
  border-right: 1px solid #e1e3e6;
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  height: 36px;
  margin-bottom: 14px;
  padding: 0 7px;
  font-size: 18px;
  font-weight: 700;
}

.brand-icon {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 1px solid #d6d8dc;
  border-radius: 7px;
  background: #fff;
}

.search {
  position: relative;
  margin-bottom: 20px;
}

.search input {
  width: 100%;
  height: 40px;
  padding: 0 12px 0 38px;
  border: 1px solid #d9dce0;
  border-radius: 9px;
  outline: none;
  background: #fff;
}

.search::before {
  content: "⌕";
  position: absolute;
  left: 13px;
  top: 8px;
  color: #777b82;
  font-size: 18px;
}

.sidebar-heading {
  margin: 0 8px 8px;
  color: #777b82;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.sidebar-card {
  padding: 14px;
  border: 1px solid #e0e2e5;
  border-radius: 10px;
  background: #fff;
}

.sidebar-card-title {
  margin-bottom: 5px;
  font-size: 14px;
  font-weight: 700;
}

.sidebar-card-text {
  color: #777b82;
  font-size: 12px;
  line-height: 1.5;
}

.folder-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.folder-item {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 38px;
  padding: 0 10px;
  border-radius: 8px;
  color: #33363b;
  font-size: 13px;
}

.folder-item:hover {
  background: #eceef1;
}

.main {
  min-width: 0;
  min-height: 100vh;
  background: #fff;
}

.topbar {
  display: flex;
  align-items: center;
  min-height: 62px;
  padding: 0 24px;
  border-bottom: 1px solid #e1e3e6;
  background: #fff;
}

.nav {
  display: flex;
  align-items: center;
  gap: 5px;
}

.nav a {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  padding: 0 12px;
  border-radius: 8px;
  color: #696d75;
  font-size: 13px;
  font-weight: 600;
}

.nav a:hover,
.nav a.active {
  background: #eceef1;
  color: #17181a;
}

.content {
  width: min(1100px, 100%);
  margin: 0 auto;
  padding: 30px;
}

.content-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
}

.content-title {
  margin: 0;
  font-size: 27px;
  font-weight: 750;
  letter-spacing: -.035em;
}

.content-subtitle {
  margin: 6px 0 0;
  color: #777b82;
  font-size: 13px;
}

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

.note-card {
  display: flex;
  min-height: 155px;
  flex-direction: column;
  padding: 17px;
  border: 1px solid #e0e2e5;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,.025);
}

.note-card:hover {
  border-color: #cfd2d6;
  box-shadow: 0 7px 20px rgba(0,0,0,.06);
}

.note-title {
  margin: 0 0 9px;
  font-size: 15px;
  font-weight: 700;
}

.note-preview {
  margin: 0;
  color: #696d75;
  font-size: 13px;
  line-height: 1.55;
}

.note-meta {
  margin-top: auto;
  padding-top: 18px;
  color: #898d94;
  font-size: 11px;
}

.empty-state {
  display: flex;
  min-height: 380px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  border: 1px dashed #d5d8dc;
  border-radius: 14px;
  background: #fafafa;
  text-align: center;
}

.empty-state h2 {
  margin: 0 0 7px;
  font-size: 18px;
}

.empty-state p {
  margin: 0 0 18px;
  color: #777b82;
  font-size: 13px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid #d9dce0;
  border-radius: 8px;
  background: #fff;
  color: #17181a;
  font-size: 13px;
  font-weight: 650;
}

.btn-primary {
  border-color: #111;
  background: #111;
  color: #fff;
}

.bottom-nav {
  display: none;
}

@media (max-width: 800px) {
  .app-shell {
    display: block;
  }

  .sidebar {
    min-height: auto;
    padding: 12px;
    border-right: 0;
    border-bottom: 1px solid #e1e3e6;
  }

  .sidebar-section {
    display: none;
  }

  .topbar {
    padding: 0 14px;
  }

  .content {
    padding: 18px 14px 90px;
  }

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

  .bottom-nav {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 50;
    display: flex;
    height: 66px;
    align-items: center;
    justify-content: space-around;
    border-top: 1px solid #dedfe2;
    background: rgba(255,255,255,.96);
    backdrop-filter: blur(12px);
  }

  .bottom-nav a {
    display: flex;
    align-items: center;
    flex-direction: column;
    gap: 4px;
    color: #777b82;
    font-size: 10px;
  }

  .bottom-nav a.active {
    color: #111;
    font-weight: 700;
  }
}

@media (max-width: 520px) {
  .content {
    padding: 16px 12px 82px;
  }

  .content-title {
    font-size: 23px;
  }

  .note-card {
    min-height: 135px;
  }
}
