/* Sharpebase app shell — browser-style sidebar + topbar + floating white panel.
   Injected by shell.js on every page; wraps each page's existing content. */
:root {
  --sky-1: #d6eafb; --sky-2: #e7f3fc; --sky-3: #f3f9fe;
  --ink: #1b2030; --muted: #6b7488; --muted-2: #9aa2b6;
  --line: #eef0f6; --accent: #5b5be7;
  --panel: #ffffff; --panel-2: #fbfcfe;
}
html, body { height: 100%; }
body { margin: 0; overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, Helvetica, Arial, sans-serif; }

.app { height: 100vh; display: flex;
  background: linear-gradient(155deg, var(--sky-1) 0%, var(--sky-2) 42%, var(--sky-3) 100%); }

/* ---------- sidebar ---------- */
.sidebar { width: 252px; flex: 0 0 252px; height: 100vh; overflow-y: auto; padding: 14px 12px 24px;
  display: flex; flex-direction: column; gap: 4px; }
.sidebar::-webkit-scrollbar { width: 0; }
.sb-head { display: flex; align-items: center; gap: 8px; padding: 4px 6px 12px; }
.sb-brand { display: flex; align-items: center; gap: 9px; cursor: default; flex: 1; min-width: 0; }
.sb-logo { width: 28px; height: 28px; border-radius: 9px; flex: 0 0 auto;
  background: linear-gradient(135deg, #6d6df0, #9b6df0); display: grid; place-items: center;
  color: #fff; font-weight: 800; font-size: 14px; box-shadow: 0 3px 10px rgba(91,91,231,.3); }
.sb-name { font-size: 15px; font-weight: 800; color: #20283c; letter-spacing: -.2px; }
.sb-name .car { color: var(--muted-2); font-weight: 600; margin-left: 3px; }
.sb-ic { width: 30px; height: 30px; border-radius: 8px; border: none; background: transparent; cursor: pointer;
  display: grid; place-items: center; color: #4a5266; transition: background .14s ease; flex: 0 0 auto; }
.sb-ic:hover { background: rgba(255,255,255,.6); }
.sb-ic svg { width: 17px; height: 17px; }

.sb-label { font-size: 11px; font-weight: 800; letter-spacing: .4px; color: #7c879c;
  padding: 14px 10px 6px; }
.sb-item { display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 10px;
  text-decoration: none; color: #2f3850; font-size: 14px; font-weight: 600; cursor: pointer;
  transition: background .13s ease; position: relative; }
.sb-item:hover { background: rgba(255,255,255,.55); }
.sb-item.active { background: #fff; box-shadow: 0 4px 14px rgba(40,60,120,.10); color: #1b2030; font-weight: 700; }
.sb-item .si { width: 19px; height: 19px; flex: 0 0 auto; display: grid; place-items: center; color: #59617a; }
.sb-item.active .si { color: var(--accent); }
.sb-item .si svg { width: 18px; height: 18px; }
.sb-item .dot { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 auto; margin: 0 5px; }
.sb-item .txt { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-item .badge { font-size: 11px; font-weight: 800; color: var(--muted-2); }

/* ---------- main panel ---------- */
.main { flex: 1; min-width: 0; height: 100vh; padding: 10px 10px 10px 0; }
.panel { height: 100%; background: var(--panel-2); border-radius: 18px; overflow: hidden;
  box-shadow: 0 12px 44px rgba(40,60,120,.10); display: flex; flex-direction: column; }

/* ---------- topbar ---------- */
.topbar { flex: 0 0 auto; display: flex; align-items: center; gap: 8px; padding: 11px 16px;
  border-bottom: 1px solid var(--line); background: rgba(255,255,255,.7); backdrop-filter: blur(8px); }
.tb-btn { width: 32px; height: 32px; border-radius: 9px; border: none; background: transparent; cursor: pointer;
  display: grid; place-items: center; color: #59617a; transition: background .14s ease; flex: 0 0 auto; }
.tb-btn:hover { background: #eef1f7; color: #2f3850; }
.tb-btn:disabled { opacity: .35; cursor: default; }
.tb-btn svg { width: 18px; height: 18px; }
.tb-omni { flex: 1; min-width: 0; display: flex; align-items: center; gap: 9px; height: 38px; padding: 0 14px;
  background: #fff; border: 1px solid var(--line); border-radius: 11px; transition: border-color .14s ease, box-shadow .14s ease; }
.tb-omni:focus-within { border-color: #cfd6ec; box-shadow: 0 2px 10px rgba(40,60,120,.07); }
.tb-omni svg { width: 16px; height: 16px; color: var(--muted-2); flex: 0 0 auto; }
.tb-omni input { flex: 1; min-width: 0; border: none; outline: none; background: transparent; font: inherit;
  font-size: 14px; color: var(--ink); }
.tb-omni input::placeholder { color: var(--muted-2); }
.tb-right { display: flex; align-items: center; gap: 4px; flex: 0 0 auto; }
.tb-key { color: var(--muted-2); display: grid; place-items: center; padding: 0 4px; }
.tb-key svg { width: 17px; height: 17px; }
.sb-toggle { display: none; }

/* ---------- content ---------- */
.content { flex: 1; min-width: 0; overflow-y: auto; }
.content.page-world { overflow: hidden; padding: 0; position: relative; }

/* the pages set their own body background; neutralize it inside the panel */
.content > .feedwrap, .content > .wrap { background: transparent; }

/* mobile drawer */
.scrim { display: none; }
@media (max-width: 880px) {
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; z-index: 60; width: 264px;
    background: linear-gradient(155deg, var(--sky-1), var(--sky-2)); transform: translateX(-100%);
    transition: transform .22s ease; box-shadow: 0 20px 60px rgba(20,30,70,.25); }
  .app.sb-open .sidebar { transform: none; }
  .main { padding: 8px; }
  .sb-toggle { display: grid; }
  .scrim { position: fixed; inset: 0; z-index: 55; background: rgba(20,30,70,.25); }
  .app.sb-open .scrim { display: block; }
}
