/* ─────────────────────────────────────────────────────────────────────────
 * Layout — Navbar, Sidebar, Shell
 * ───────────────────────────────────────────────────────────────────────── */

/* ── Navbar ─────────────────────────────────────────────────────────────── */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 0;
  height: var(--navbar-h);
  background: var(--navbar-bg);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: .5px solid var(--separator);
  padding: 0 20px;
  user-select: none;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-right: 24px;
  text-decoration: none;
  flex-shrink: 0;
}
.navbar-brand:hover { text-decoration: none; }

.navbar-date-badge {
  background: var(--red);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  border-radius: 7px;
  min-width: 26px;
  height: 26px;
  padding: 0 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(255, 59, 48, .35);
  letter-spacing: -.3px;
  transition: background .2s;
}
.navbar-date-badge.zero {
  background: var(--gray4);
  color: var(--secondary-label);
  box-shadow: none;
}

.navbar-date {
  font-size: 15px;
  font-weight: 600;
  color: var(--label);
  letter-spacing: -.2px;
  white-space: nowrap;
}

/* ── Nav tabs (top navigation) ── */
.nav-tabs {
  display: flex;
  gap: 2px;
  overflow-x: auto;
  scrollbar-width: none;
}
.nav-tabs::-webkit-scrollbar { display: none; }

.nav-tab {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  color: var(--secondary-label);
  cursor: pointer;
  transition: background .15s, color .15s;
  white-space: nowrap;
  border: none;
  background: none;
  text-decoration: none;
}
.nav-tab:hover {
  background: var(--fill3);
  color: var(--label);
  text-decoration: none;
}
.nav-tab.active, .nav-tab[aria-current="page"] {
  background: var(--fill2);
  color: var(--blue);
}
.nav-tab svg { width: 15px; height: 15px; flex-shrink: 0; }
.chevron-icon { width: 10px !important; height: 10px !important; }

/* ── Nav dropdown ── */
.nav-dropdown { position: relative; }

.nav-dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  background: var(--bg2);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: .5px solid var(--separator);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 6px;
  min-width: 200px;
  z-index: 200;
}
.nav-dropdown-menu[hidden] { display: none; }

.nav-dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  font-size: 14px;
  color: var(--label);
  border-radius: 6px;
  cursor: pointer;
  transition: background .1s, color .1s;
  text-decoration: none;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-family: inherit;
}
.nav-dropdown-item:hover {
  background: var(--blue);
  color: #fff;
  text-decoration: none;
}
.nav-dropdown-item svg { width: 14px; height: 14px; flex-shrink: 0; }
.nav-dropdown-item--button { cursor: pointer; }
.nav-dropdown-separator {
  height: .5px;
  background: var(--separator);
  margin: 4px 0;
}
.nav-dropdown-user {
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  cursor: default;
  pointer-events: none;
  font-size: 13px;
}
.nav-dropdown-user strong { font-size: 14px; }
.nav-dropdown-user small { color: var(--secondary-label); }
.nav-dropdown-user:hover { background: none; color: var(--label); }

/* Account dropdown aligns to the right edge of its trigger */
.navbar-actions .nav-dropdown-menu { left: auto; right: 0; }

/* ── Navbar right-side actions ── */
.navbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  flex-shrink: 0;
}

.search-form { display: flex; }
.search-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--fill3);
  border-radius: var(--radius-sm);
  padding: 5px 10px;
  width: 200px;
  transition: width .2s, background .15s;
}
.search-bar:focus-within {
  width: 260px;
  background: var(--fill2);
}
.search-bar input {
  border: none;
  background: none;
  font-size: 14px;
  color: var(--label);
  outline: none;
  width: 100%;
}
.search-bar input::placeholder { color: var(--placeholder); }
.search-bar svg {
  color: var(--secondary-label);
  flex-shrink: 0;
  width: 14px;
  height: 14px;
}

.icon-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  border: none;
  background: none;
  cursor: pointer;
  color: var(--blue);
  transition: background .15s;
}
.icon-btn:hover { background: var(--fill3); }
.icon-btn svg { width: 20px; height: 20px; }

/* ── App shell ── */
.app-shell.with-nav {
  display: flex;
  min-height: calc(100vh - var(--navbar-h));
}

/* ── Sidebar ── */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--bg2);
  border-right: .5px solid var(--separator);
  padding: 16px 0;
  overflow-y: auto;
  position: sticky;
  top: var(--navbar-h);
  height: calc(100vh - var(--navbar-h));
}

.sidebar-section { margin-bottom: 8px; }

.sidebar-section-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--secondary-label);
  text-transform: uppercase;
  letter-spacing: .5px;
  padding: 4px 16px 6px;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 16px;
  font-size: 14px;
  font-weight: 400;
  color: var(--label);
  cursor: pointer;
  transition: background .1s;
  text-decoration: none;
  width: 100%;
}
.sidebar-item:hover {
  background: var(--fill3);
  text-decoration: none;
  color: var(--label);
}
.sidebar-item.active,
.sidebar-item[aria-current="page"] {
  background: rgba(0, 122, 255, .10);
  color: var(--blue);
  font-weight: 500;
}
.sidebar-item.active .sidebar-item-icon { color: var(--blue); }

.sidebar-item-icon {
  width: 18px;
  height: 18px;
  color: var(--secondary-label);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.sidebar-item-icon svg { width: 14px; height: 14px; }

.sidebar-item-badge {
  margin-left: auto;
  background: var(--gray4);
  color: var(--secondary-label);
  font-size: 11px;
  font-weight: 600;
  border-radius: 8px;
  padding: 1px 6px;
  min-width: 20px;
  text-align: center;
}
.sidebar-item.active .sidebar-item-badge,
.sidebar-item[aria-current="page"] .sidebar-item-badge {
  background: var(--blue);
  color: #fff;
}

.sidebar-item--add { color: var(--secondary-label); font-size: 13px; }
.sidebar-item--add:hover { color: var(--blue); }

.sidebar-empty {
  font-size: 12px;
  color: var(--tertiary-label);
  padding: 4px 16px 8px;
}

.project-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ── Main content area ── */
.main-content {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  min-width: 0;
}

.content-with-panel {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}
.content-area { flex: 1; min-width: 0; }

/* ── Auth layout (unauthenticated pages) ── */
.auth-content {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  padding: 20px;
}

/* ── Page header ── */
.page-header {
  margin-bottom: 20px;
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}
.page-title {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -.5px;
  color: var(--label);
}
.page-subtitle {
  font-size: 14px;
  color: var(--secondary-label);
}
.page-actions { margin-left: auto; display: flex; gap: 8px; }
