/* ADMIN CSS 2/4 — layout: sidebar (drawer on phones), top bar, bottom tab bar, content */
:root { --sb-w: 268px; --tb-h: 56px; --tab-h: 60px; }
.app { min-height: 100vh; }
.main-col { min-width: 0; padding-bottom: calc(var(--tab-h) + var(--safe-b) + 8px); }

/* sidebar */
.sidebar { position: fixed; z-index: 120; top: 0; bottom: 0; left: 0; width: min(84vw, var(--sb-w)); display: flex; flex-direction: column; background: var(--navy); color: #c9d4e6; transform: translateX(-102%); transition: transform .22s ease; }
.sidebar.open { transform: none; box-shadow: var(--shadow-lg); }
.sb-overlay { position: fixed; inset: 0; z-index: 110; background: rgba(8, 18, 34, .55); opacity: 0; pointer-events: none; transition: opacity .2s; }
.sb-overlay.open { opacity: 1; pointer-events: auto; }
.sb-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid rgba(255, 255, 255, .08); }
.sb-head img { height: 34px; width: auto; }
.sb-close { background: rgba(255, 255, 255, .08); color: #fff; }
.sb-nav { flex: 1; overflow-y: auto; padding: 8px 10px 14px; -webkit-overflow-scrolling: touch; }
.nav-group { margin-top: 12px; }
.nav-title { font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; color: #7f93b3; padding: 6px 10px; font-weight: 700; }
.nav-item { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 12px; color: #d6e0f0; font-weight: 600; font-size: 14.5px; text-decoration: none !important; position: relative; }
.nav-item:hover { background: rgba(255, 255, 255, .07); }
.nav-item.active { background: var(--brand); color: var(--on-brand); }
.nav-item .nb { margin-left: auto; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 99px; background: var(--accent); color: #fff; font-size: 12px; line-height: 22px; text-align: center; font-weight: 800; }
.sb-foot { border-top: 1px solid rgba(255, 255, 255, .08); padding: 10px; display: grid; gap: 2px; }
.sb-link { display: flex; align-items: center; gap: 12px; width: 100%; padding: 11px 12px; border: 0; background: none; border-radius: 12px; color: #c9d4e6; font-weight: 600; text-align: left; text-decoration: none !important; }
.sb-link:hover { background: rgba(255, 255, 255, .07); }

/* top bar */
.topbar { position: sticky; top: 0; z-index: 60; display: flex; align-items: center; gap: 10px; height: var(--tb-h); padding: 0 12px; background: #fff; border-bottom: 1px solid var(--line); }
.topbar h1 { margin: 0; font-size: 18px; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-actions { display: flex; gap: 8px; align-items: center; }
.icon-btn { width: 42px; height: 42px; display: inline-grid; place-items: center; border: 0; border-radius: 12px; background: transparent; color: var(--text); }
.icon-btn:hover { background: var(--bg); }

/* content */
.view { padding: 14px 12px 20px; max-width: 1180px; margin: 0 auto; outline: 0; animation: fade .18s ease; }
@keyframes fade { from { opacity: .4; } to { opacity: 1; } }
.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.page-head h2 { margin: 0; font-size: 20px; } .page-head p { margin: 2px 0 0; color: var(--muted); font-size: 13.5px; }

/* bottom tab bar (phones) */
.tabbar { position: fixed; z-index: 100; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: repeat(5, 1fr); background: #fff; border-top: 1px solid var(--line); padding-bottom: var(--safe-b); box-shadow: 0 -4px 18px rgba(15, 27, 45, .07); }
.tabbar a, .tabbar button { position: relative; height: var(--tab-h); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border: 0; background: none; color: var(--muted); font-size: 11.5px; font-weight: 700; text-decoration: none !important; -webkit-tap-highlight-color: transparent; }
.tabbar .active { color: var(--brand-dark); } .tabbar .active::before { content: ""; position: absolute; top: 0; left: 30%; right: 30%; height: 3px; background: var(--brand); border-radius: 0 0 4px 4px; }
.tabbar .tb-badge { position: absolute; top: 6px; left: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: var(--accent); color: #fff; font-size: 11px; line-height: 18px; font-weight: 800; }

@media (min-width: 1024px) {
  .sidebar { transform: none; width: var(--sb-w); }
  .sb-overlay, .sb-close, .menu-btn, .tabbar { display: none !important; }
  .main-col { margin-left: var(--sb-w); padding-bottom: 24px; }
  .topbar { padding: 0 24px; } .view { padding: 22px 24px 34px; }
}
