/* ============================================================
   layout.css — shell, sidebar, main, page headers
   ============================================================ */

.shell {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}

/* ============ SIDEBAR ============ */
.sidebar {
  background: var(--bg-sidebar);
  backdrop-filter: blur(40px) saturate(180%);
  -webkit-backdrop-filter: blur(40px) saturate(180%);
  border-right: 0.5px solid var(--separator);
  padding: 24px 12px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.sidebar-brand {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  padding: 8px 10px 20px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.sidebar-brand::before {
  content: '';
  width: 22px; height: 22px;
  border-radius: 6px;
  background: linear-gradient(135deg, var(--sys-blue) 0%, var(--sys-purple) 100%);
  box-shadow: 0 2px 6px rgba(10, 132, 255, 0.3);
}

.sidebar-brand em {
  color: var(--text-secondary);
  font-style: normal;
  font-weight: 400;
}

.nav-section {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-tertiary);
  padding: 12px 10px 4px;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 1px;
  margin-bottom: 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-radius: var(--r-sm);
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  border: none;
  background: transparent;
  font-family: var(--font-system);
  text-align: left;
  width: 100%;
  transition: background 0.1s ease;
  font-weight: 400;
}

.nav-item:hover { background: rgba(255, 255, 255, 0.06); }
.nav-item.active {
  background: var(--sys-blue);
  color: #fff;
  font-weight: 500;
}
.nav-item.active .nav-icon { stroke: #fff; }

.nav-icon {
  width: 16px; height: 16px;
  stroke: var(--text-secondary);
  stroke-width: 1.8;
  fill: none;
  flex-shrink: 0;
}
.nav-item.active .nav-badge { background: rgba(255, 255, 255, 0.25); color: #fff; }

.nav-badge {
  margin-left: auto;
  font-size: 11px;
  font-weight: 500;
  background: var(--bg-input);
  padding: 1px 7px;
  border-radius: var(--r-full);
  color: var(--text-secondary);
  min-width: 20px;
  text-align: center;
}

.sidebar-footer {
  margin-top: auto;
  padding: 10px;
  font-size: 11px;
  color: var(--text-tertiary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.sidebar-footer::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--sys-green);
  box-shadow: 0 0 6px var(--sys-green);
}

/* ============ MAIN ============ */
.sidebar-overlay { display: none; }

.main {
  padding: 40px 48px 120px;
  max-width: 1200px;
  overflow-x: hidden;
}

/* ============ MOBILE HEADER ============ */
.mobile-header {
  display: none;
  padding: 14px 20px;
  background: var(--bg-sidebar);
  backdrop-filter: blur(30px) saturate(180%);
  -webkit-backdrop-filter: blur(30px) saturate(180%);
  border-bottom: 0.5px solid var(--separator);
  position: sticky;
  top: 0;
  z-index: 30;
  justify-content: space-between;
  align-items: center;
}

.mobile-brand {
  font-size: 17px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}
.mobile-brand::before {
  content: '';
  width: 22px; height: 22px;
  border-radius: 6px;
  background: linear-gradient(135deg, var(--sys-blue) 0%, var(--sys-purple) 100%);
}

.menu-btn {
  background: var(--bg-input);
  border: none;
  border-radius: var(--r-sm);
  padding: 8px 10px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.menu-btn span { width: 16px; height: 1.5px; background: var(--text); border-radius: 1px; }

/* ============ PAGE HEADER ============ */
.page-header {
  margin-bottom: 28px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  flex-wrap: wrap;
}

.page-title {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 4px;
}

/* ============ MONTH NAVIGATION (dashboard) ============ */
.page-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
  flex-wrap: wrap;
}

.page-title-wrap .page-title { margin-bottom: 0; }

.month-nav-btn {
  background: var(--bg-input);
  border: none;
  width: 36px;
  height: 36px;
  border-radius: var(--r-sm);
  cursor: pointer;
  font-size: 18px;
  color: var(--text);
  font-family: var(--font-system);
  font-weight: 400;
  line-height: 1;
  transition: background 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.month-nav-btn:hover { background: rgba(118, 118, 128, 0.36); }
.month-nav-btn:active { background: var(--sys-blue); color: #fff; }

.month-today-btn {
  background: var(--sys-blue);
  color: #fff;
  border: none;
  padding: 0 14px;
  height: 36px;
  border-radius: var(--r-sm);
  cursor: pointer;
  font-family: var(--font-system);
  font-size: 13px;
  font-weight: 600;
  margin-left: 6px;
  transition: background 0.15s;
}
.month-today-btn:hover { background: #409cff; }

.page-sub {
  font-size: 13px;
  color: var(--text-secondary);
}

.page-action {
  background: var(--sys-blue);
  color: #fff;
  border: none;
  padding: 7px 14px;
  border-radius: var(--r-sm);
  font-family: var(--font-system);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
  display: flex;
  align-items: center;
  gap: 6px;
  letter-spacing: -0.005em;
}
.page-action:hover { background: #409cff; }
.page-action:active { background: #0868cc; }
.page-action .plus { font-size: 14px; font-weight: 400; line-height: 1; }

.page-action.secondary {
  background: var(--bg-input);
  color: var(--text);
}
.page-action.secondary:hover { background: rgba(118, 118, 128, 0.36); }

/* ============ SECTIONS ============ */
section { margin-bottom: 32px; }

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 12px;
  padding: 0 4px;
}

.section-title {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--text-secondary);
}

.section-sub {
  font-size: 12px;
  color: var(--text-tertiary);
}

.page-content > * { animation: fadeUp 0.4s cubic-bezier(0.32, 0.72, 0, 1) backwards; }
.page-content > *:nth-child(2) { animation-delay: 0.05s; }
.page-content > *:nth-child(3) { animation-delay: 0.1s; }
.page-content > *:nth-child(4) { animation-delay: 0.15s; }
