/* 念念 Web — 后台布局 + 通用 */

/* ===== Shell ===== */
.nn-shell { display: grid; grid-template-columns: 252px 1fr; height: 100vh; overflow: hidden; }

/* ===== Sidebar ===== */
.nn-sidebar {
  display: flex; flex-direction: column;
  background: var(--surface);
  border-right: 1px solid var(--border);
  height: 100vh; overflow: hidden;
}
.nn-side-brand { padding: 22px 22px 14px; }
.nn-nav { flex: 1; overflow-y: auto; padding: 6px 14px 10px; }
.nn-nav-group { margin-bottom: 16px; }
.nn-nav-label { font-size: 11px; font-weight: 600; letter-spacing: .14em; color: var(--text-faint); padding: 6px 12px; text-transform: uppercase; }
.nn-nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 12px; border-radius: var(--radius-sm);
  color: var(--text-2); font-size: 14px; font-weight: 500;
  margin-bottom: 2px; position: relative; transition: background .14s, color .14s;
}
.nn-nav-item:hover { background: var(--surface-2); color: var(--text); }
.nn-nav-item.active { background: var(--accent-soft); color: var(--accent-deep); }
.nn-nav-item.active .nn-nav-ic { color: var(--accent); }
.nn-nav-ic { display: grid; place-items: center; color: var(--text-3); transition: color .14s; }
.nn-nav-count { margin-left: auto; font-size: 11px; font-weight: 600; background: var(--surface-3); color: var(--text-3); padding: 1px 7px; border-radius: 99px; }
.nn-side-foot { padding: 12px 14px; border-top: 1px solid var(--border); }
.nn-side-public {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 10px 12px; border-radius: var(--radius-sm);
  color: var(--text-2); font-size: 13.5px; font-weight: 500; transition: background .14s, color .14s;
}
.nn-side-public:hover { background: var(--accent-soft); color: var(--accent-deep); }

/* ===== Main / Topbar ===== */
.nn-main { display: flex; flex-direction: column; height: 100vh; overflow: hidden; }
.nn-topbar {
  display: flex; align-items: center; gap: 16px;
  height: 66px; padding: 0 var(--gutter); flex: none;
  border-bottom: 1px solid var(--border); background: color-mix(in oklch, var(--surface) 82%, transparent);
  backdrop-filter: blur(8px); position: relative; z-index: 20;
}
.nn-tb-left { display: flex; align-items: baseline; gap: 14px; min-width: 0; }
.nn-tb-title { font-size: 19px; font-weight: 600; margin: 0; }
.nn-tb-sub { font-size: 12.5px; color: var(--text-3); white-space: nowrap; }
.nn-tb-right { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.nn-search {
  display: flex; align-items: center; gap: 8px;
  width: 290px; height: 38px; padding: 0 11px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm);
  transition: border-color .15s, box-shadow .15s;
}
.nn-search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); background: var(--surface); }
.nn-search input { flex: 1; border: none; background: transparent; outline: none; color: var(--text); font-size: 13.5px; min-width: 0; }
.nn-search input::placeholder { color: var(--text-faint); }
.nn-search kbd { font-size: 11px; color: var(--text-faint); background: var(--surface); border: 1px solid var(--border); border-radius: 5px; padding: 1px 5px; font-family: var(--font-sans); }
.nn-new { position: relative; }
.nn-menu {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 40;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg);
  padding: 6px; min-width: 176px;
}
@media (prefers-reduced-motion: no-preference) { .nn-menu { animation: nnMenuIn .16s ease; } }
@keyframes nnMenuIn { from { transform: translateY(-6px); } to { transform: none; } }
.nn-menu-item { display: flex; align-items: center; gap: 10px; padding: 9px 11px; border-radius: var(--radius-sm); font-size: 14px; color: var(--text); }
.nn-menu-item:hover { background: var(--surface-2); }
.nn-avatar {
  width: 38px; height: 38px; border-radius: 50%; flex: none;
  background: linear-gradient(150deg, var(--accent), var(--accent-strong)); color: #fff;
  display: grid; place-items: center; font-family: var(--font-serif); font-weight: 600; font-size: 16px;
  cursor: pointer; box-shadow: 0 2px 6px var(--accent-ring);
}

/* ===== Content / page scaffolding ===== */
.nn-content { flex: 1; overflow-y: auto; padding: var(--gutter); }
@media (prefers-reduced-motion: no-preference) { .nn-content { animation: nnRise .3s ease; } }
@keyframes nnRise { from { transform: translateY(8px); } to { transform: none; } }
.nn-page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.nn-page-head h1 { font-size: 25px; font-weight: 600; margin: 0; letter-spacing: -.01em; }
.nn-page-head p { margin: 6px 0 0; color: var(--text-3); font-size: 14px; max-width: 64ch; }
.nn-page-actions { display: flex; align-items: center; gap: 10px; flex: none; }
.nn-sec-title { display: flex; align-items: center; justify-content: space-between; margin: 0 0 14px; }
.nn-sec-title h3 { font-size: 16px; font-weight: 600; margin: 0; }
.nn-sec-title a, .nn-sec-link { font-size: 13px; color: var(--accent-deep); font-weight: 500; }
.nn-sec-title a:hover { text-decoration: underline; }

/* ===== Tag pill ===== */
.nn-tag-pill {
  display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px;
  border-radius: var(--radius-pill); font-size: 12px; font-weight: 500;
  color: var(--tc); background: color-mix(in oklch, var(--tc) 13%, transparent);
}
.nn-tag-pill::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: var(--tc); }

/* ===== Empty placeholder ===== */
.nn-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  padding: 70px 30px; color: var(--text-3); gap: 14px;
}
.nn-empty .ic { width: 64px; height: 64px; border-radius: 18px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; }
.nn-empty h3 { font-size: 17px; color: var(--text); margin: 0; font-weight: 600; }
.nn-empty p { margin: 0; max-width: 44ch; font-size: 14px; }
.nn-empty .feats { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 6px; }

/* ===== Grids ===== */
.nn-grid { display: grid; gap: 18px; }
.nn-stat-card { padding: 18px 20px; cursor: pointer; transition: transform .14s, box-shadow .14s, border-color .14s; }
.nn-stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--border-strong); }
.nn-stat-card .label { font-size: 13px; color: var(--text-3); display: flex; align-items: center; gap: 7px; }
.nn-stat-card .value { font-size: 30px; font-weight: 700; margin-top: 8px; letter-spacing: -.02em; }
.nn-stat-card .delta { font-size: 12px; color: var(--text-faint); margin-top: 3px; }

/* ===== List rows ===== */
.nn-row { display: flex; align-items: center; gap: 14px; padding: 13px 16px; border-radius: var(--radius-sm); transition: background .14s; cursor: pointer; }
.nn-row:hover { background: var(--surface-2); }
.nn-row + .nn-row { border-top: 1px solid var(--border); }
.nn-row-title { font-weight: 500; font-size: 14.5px; }
.nn-row-meta { font-size: 12.5px; color: var(--text-3); }

/* ===== Drawer ===== */
.nn-drawer-mask { position: fixed; inset: 0; background: oklch(0.2 0.02 235 / 0.42); z-index: 80; }
.nn-drawer {
  position: fixed; top: 0; right: 0; height: 100vh; width: 460px; max-width: 94vw; z-index: 90;
  background: var(--surface); border-left: 1px solid var(--border); box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column;
}
@media (prefers-reduced-motion: no-preference) { .nn-drawer { animation: nnSlideIn .28s cubic-bezier(.22,.61,.36,1); } }
@keyframes nnSlideIn { from { transform: translateX(26px); } to { transform: none; } }
.nn-drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--border); flex: none; }
.nn-drawer-body { flex: 1; overflow-y: auto; padding: 22px; }
.nn-drawer-foot { padding: 14px 22px; border-top: 1px solid var(--border); display: flex; align-items: center; gap: 10px; flex: none; }
.nn-tabs { display: flex; gap: 4px; background: var(--surface-2); padding: 4px; border-radius: var(--radius-sm); }
.nn-tab { flex: 1; text-align: center; white-space: nowrap; padding: 7px 12px; border-radius: calc(var(--radius-sm) - 2px); font-size: 13.5px; font-weight: 500; color: var(--text-3); cursor: pointer; transition: all .14s; border: none; background: transparent; }
.nn-tab.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

/* iconbtn */
.nn-iconbtn { width: 34px; height: 34px; border-radius: var(--radius-sm); border: none; background: transparent; color: var(--text-3); display: grid; place-items: center; transition: background .14s, color .14s; }
.nn-iconbtn:hover { background: var(--surface-2); color: var(--text); }
