/* AppLayout, sidebar, header, PageHeader y Card. */
/* ---------- AppLayout ---------- */
.app { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: var(--s4); padding: var(--s4) var(--s3);
  background: var(--surface); border-right: 1px solid var(--border); z-index: 30; }
.sidebar .brand { display: flex; align-items: center; gap: var(--s3); padding: var(--s2) var(--s2) var(--s3); border-bottom: 1px solid var(--border); color: var(--text); }
.brand-logo { height: 36px; width: auto; display: block; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text strong { font-size: 15px; }
.brand-text span { font-size: var(--fs-label); color: var(--text-muted); }
.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; overflow-y: auto; }
.nav-label { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted); padding: var(--s3) var(--s3) var(--s1); font-weight: 600; }
.nav a, .nav-btn { position: relative; display: flex; align-items: center; gap: var(--s3); padding: 9px var(--s3); border-radius: var(--r-btn);
  color: var(--text-muted); font-weight: 500; font-size: var(--fs-body); text-decoration: none; background: none; border: 0; font-family: inherit; cursor: pointer; text-align: left; width: 100%; }
.nav a:hover, .nav-btn:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.nav a.active { background: var(--blue-soft); color: var(--blue); font-weight: 600; }
.nav a.active::before { content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 4px; border-radius: 0 4px 4px 0; background: var(--blue); }
.sidebar-foot { border-top: 1px solid var(--border); padding-top: var(--s3); display: flex; flex-direction: column; gap: 2px; }
.main { min-width: 0; display: flex; flex-direction: column; }
.header { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: var(--s3); min-height: 56px; padding: 0 var(--s8);
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); }
.breadcrumb { display: flex; align-items: center; gap: var(--s1); font-size: var(--fs-sm); color: var(--text-muted); min-width: 0; flex: 1; }
.breadcrumb ol { display: flex; align-items: center; gap: var(--s1); list-style: none; margin: 0; padding: 0; min-width: 0; flex-wrap: wrap; }
.breadcrumb li { display: inline-flex; align-items: center; gap: var(--s1); }
.breadcrumb li[aria-current] { color: var(--text); font-weight: 600; }
.menu-btn { display: inline-flex; }
main { width: 100%; max-width: 1320px; margin: 0 auto; padding: var(--s6) var(--s8) var(--s12); }
.scrim { display: none; }
@media (min-width: 761px) {
  .app.sidebar-hidden { grid-template-columns: minmax(0, 1fr); }
  .app.sidebar-hidden > .sidebar { display: none; }
}

/* ---------- PageHeader ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s4); margin-bottom: var(--s6); flex-wrap: wrap; }
.page-head .lead { margin: var(--s2) 0 0; color: var(--text-muted); font-size: 15px; max-width: 70ch; }
.page-actions, .row { display: flex; gap: var(--s2); align-items: center; flex-wrap: wrap; }

/* ---------- Card ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card); padding: var(--s6); box-shadow: var(--shadow); margin-bottom: var(--s4); }
.card.flush { padding: 0; overflow: hidden; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); margin-bottom: var(--s4); flex-wrap: wrap; }
.card-head h2 { margin: 0; display: flex; align-items: center; gap: var(--s2); }
.card-sub { margin: -8px 0 var(--s4); color: var(--text-muted); font-size: var(--fs-sm); }
