/* Phase 7 — unified administrative management */
:root {
  --p7-ink: #171612;
  --p7-muted: #6f6a5e;
  --p7-cream: #f7f2e8;
  --p7-paper: #fffdf8;
  --p7-line: #ded5c5;
  --p7-gold: #a77720;
  --p7-gold-dark: #75500f;
  --p7-success: #2d6a4f;
  --p7-warning: #9a6400;
  --p7-danger: #9f2d2d;
  --p7-info: #315f78;
  --p7-shadow: 0 18px 50px rgba(31, 27, 19, .09);
}
[data-theme="dark"] {
  --p7-ink: #f6f0e4;
  --p7-muted: #b9b09f;
  --p7-cream: #151410;
  --p7-paper: #1c1a15;
  --p7-line: #3c382f;
  --p7-gold: #d0a24d;
  --p7-gold-dark: #e0ba70;
  --p7-shadow: 0 18px 50px rgba(0, 0, 0, .28);
}
.p7-shell { min-height: 100vh; display: grid; grid-template-columns: 285px minmax(0, 1fr); background: var(--p7-cream); color: var(--p7-ink); }
.p7-sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; background: #151411; color: #f7f2e8; border-right: 1px solid rgba(255,255,255,.08); z-index: 50; }
.p7-sidebar-brand { padding: 25px 22px 20px; border-bottom: 1px solid rgba(255,255,255,.09); }
.p7-brand { display: flex; gap: 12px; align-items: center; color: inherit; text-decoration: none; }
.p7-brand img { width: 42px; height: 42px; }
.p7-brand span { display: grid; gap: 2px; }
.p7-brand strong { font-family: Georgia, serif; font-size: 1rem; letter-spacing: .01em; }
.p7-brand small { color: #c8bda9; font-size: .72rem; text-transform: uppercase; letter-spacing: .11em; }
.p7-nav { padding: 18px 13px 24px; overflow-y: auto; display: grid; align-content: start; gap: 4px; }
.p7-nav-label { margin: 15px 10px 6px; color: #9f9583; font-size: .67rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.p7-nav-link, .p7-injected-link { display: flex; align-items: center; gap: 11px; min-height: 42px; padding: 9px 11px; border-radius: 9px; color: #d8d0c2; text-decoration: none; font-size: .88rem; border: 1px solid transparent; background: transparent; }
.p7-nav-link:hover, .p7-nav-link.active, .p7-injected-link:hover { color: #fffaf0; background: rgba(255,255,255,.075); border-color: rgba(255,255,255,.08); }
.p7-nav-link.active { box-shadow: inset 3px 0 0 #d0a24d; }
.p7-nav-link .icon, .p7-injected-link .icon { width: 19px; height: 19px; flex: 0 0 auto; }
.p7-sidebar-user { margin-top: auto; padding: 17px 18px; border-top: 1px solid rgba(255,255,255,.09); display: flex; gap: 11px; align-items: center; }
.p7-sidebar-user > div { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; background: #d0a24d; color: #151411; font-weight: 900; }
.p7-sidebar-user span { min-width: 0; display: grid; gap: 2px; }
.p7-sidebar-user strong, .p7-sidebar-user small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.p7-sidebar-user strong { font-size: .86rem; }
.p7-sidebar-user small { color: #aaa08e; font-size: .73rem; }
.p7-main { min-width: 0; }
.p7-topbar { position: sticky; top: 0; z-index: 35; min-height: 74px; padding: 13px clamp(18px, 3vw, 40px); display: flex; align-items: center; gap: 15px; justify-content: space-between; background: color-mix(in srgb, var(--p7-paper) 94%, transparent); backdrop-filter: blur(15px); border-bottom: 1px solid var(--p7-line); }
.p7-topbar > div:first-of-type { display: grid; gap: 2px; flex: 1; }
.p7-topbar span { color: var(--p7-muted); font-size: .7rem; text-transform: uppercase; letter-spacing: .11em; font-weight: 800; }
.p7-topbar strong { font-size: .98rem; }
.p7-topbar-actions { display: flex; gap: 9px; align-items: center; }
.p7-icon-button { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 9px; border: 1px solid var(--p7-line); background: var(--p7-paper); color: var(--p7-ink); cursor: pointer; }
.p7-icon-button .icon { width: 18px; height: 18px; }
.p7-menu-button { display: none; }
.p7-content { width: min(1480px, 100%); margin: 0 auto; padding: clamp(24px, 4vw, 48px); }
.p7-page-heading { display: flex; justify-content: space-between; gap: 25px; align-items: flex-start; margin-bottom: 27px; }
.p7-page-heading > div:first-child { max-width: 850px; }
.p7-kicker { margin: 0 0 7px; color: var(--p7-gold-dark); font-weight: 900; font-size: .71rem; text-transform: uppercase; letter-spacing: .14em; }
.p7-page-heading h1 { margin: 0; font-family: Georgia, serif; font-size: clamp(1.85rem, 3vw, 3rem); line-height: 1.07; }
.p7-page-heading p:not(.p7-kicker) { max-width: 780px; margin: 11px 0 0; color: var(--p7-muted); line-height: 1.65; }
.p7-heading-actions { display: flex; flex-wrap: wrap; gap: 9px; justify-content: flex-end; }
.p7-heading-actions .btn .icon, .p7-topbar-actions .btn .icon { width: 17px; height: 17px; }
.p7-metric-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 13px; margin-bottom: 21px; }
.p7-metric { position: relative; min-height: 142px; padding: 19px; display: flex; flex-direction: column; text-decoration: none; color: var(--p7-ink); background: var(--p7-paper); border: 1px solid var(--p7-line); border-radius: 14px; box-shadow: var(--p7-shadow); overflow: hidden; }
.p7-metric::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--p7-info); }
.p7-metric-success::before { background: var(--p7-success); }.p7-metric-warning::before { background: var(--p7-warning); }.p7-metric-danger::before { background: var(--p7-danger); }
.p7-metric span { color: var(--p7-muted); font-size: .76rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 800; }
.p7-metric strong { margin-top: auto; font-family: Georgia, serif; font-size: 2.25rem; }
.p7-metric small { color: var(--p7-muted); line-height: 1.35; }
.p7-grid { display: grid; gap: 18px; margin-bottom: 20px; }.p7-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }.p7-card-span-2 { grid-column: 1 / -1; }
.p7-card, .p7-table-card, .p7-filter-card, .p7-summary-bar { background: var(--p7-paper); border: 1px solid var(--p7-line); border-radius: 15px; box-shadow: var(--p7-shadow); }
.p7-card { padding: clamp(20px, 2.5vw, 30px); }
.p7-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
.p7-card-head h2 { margin: 0; font-family: Georgia, serif; font-size: 1.35rem; }.p7-card-head a { color: var(--p7-gold-dark); text-decoration: none; font-weight: 800; font-size: .82rem; }.p7-card-head small { color: var(--p7-muted); }
