:root{
  --bg0:#070A0F;
  --bg1:#0B1020;
  --card:#0B1224cc;
  --card2:#0B1224;
  --stroke:#1b2a4a;
  --text:#e8ecff;
  --muted:#9aa7c6;
  --accent:#58d1c9;
  --accent2:#5aa3ff;
  --danger:#ff5c5c;
  --shadow: 0 10px 35px rgba(0,0,0,.55);
  --radius: 18px;
}
*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
  color:var(--text);
  background: radial-gradient(1200px 900px at 15% 10%, rgba(90,163,255,.22), transparent 60%),
              radial-gradient(1000px 800px at 85% 20%, rgba(88,209,201,.18), transparent 55%),
              linear-gradient(180deg, var(--bg1), var(--bg0));
}
.bg{position:fixed;inset:0;pointer-events:none;opacity:.55;background:
  radial-gradient(900px 500px at 60% 0%, rgba(132,83,255,.18), transparent 60%),
  radial-gradient(700px 450px at 30% 90%, rgba(88,209,201,.13), transparent 60%);
}

a{color:inherit;text-decoration:none}

.container{max-width:1100px;margin:0 auto;padding:22px 18px 60px}
.container.wide{max-width:1240px}

.shell{display:flex;min-height:100vh}
.sidebar{width:280px;flex:0 0 280px;
  /* Make the sidebar a flex column so the logout button can be pinned to the bottom */
  display:flex;flex-direction:column;
  position:sticky;top:0;align-self:flex-start;height:100vh;min-height:100vh;
  /* Allow long menus (staff + user) without overlapping the footer */
  overflow-y:auto;
  padding:16px 14px;
  border-right:1px solid rgba(27,42,74,.7);
  backdrop-filter: blur(14px);
  /* Solid base prevents visible "banding" where the page background can bleed through */
  background-color: rgba(8,10,18,.82);
  background-image: linear-gradient(180deg, rgba(8,10,18,.88), rgba(8,10,18,.60));
}
.sidebarTop{margin-bottom:14px}
.subtext{color:rgba(154,167,198,.8);font-size:12px;margin-top:2px}
.navGroup{margin:14px 0}
.navGroupTitle{font-size:11px;letter-spacing:.18em;text-transform:uppercase;color:rgba(154,167,198,.65);margin:10px 8px}
.sideLink{display:flex;align-items:center;gap:10px;padding:10px 10px;border-radius:14px;color:rgba(154,167,198,.92)}
.sideLink:hover{background:rgba(27,42,74,.35);color:var(--text)}
.sidebarBottom{margin-top:auto}
.btn.full{width:100%}

.content{flex:1;min-width:0;display:flex;flex-direction:column;min-height:100vh}
.content > .container{flex:1}
.topTitle{display:flex;flex-direction:column;gap:2px}
.crumb{font-size:11px;letter-spacing:.14em;text-transform:uppercase;color:rgba(154,167,198,.65)}
.pageTitle{font-weight:900;font-size:16px}
.topActions{display:flex;gap:10px;align-items:center}

.topbar{
  position:sticky;top:0;z-index:10;
  display:flex;align-items:center;justify-content:space-between;
  padding:14px 18px;
  border-bottom:1px solid rgba(27,42,74,.7);
  backdrop-filter: blur(14px);
  background: linear-gradient(180deg, rgba(8,10,18,.8), rgba(8,10,18,.45));
}
.brand{display:flex;align-items:center;gap:10px}
.logo{width:34px;height:34px;display:inline-flex;align-items:center;justify-content:center;border-radius:12px;
  background: linear-gradient(135deg, rgba(88,209,201,.25), rgba(90,163,255,.2));
  border:1px solid rgba(27,42,74,.9);
  box-shadow: var(--shadow);
  font-weight:800;
}
.brandtext{font-weight:700;letter-spacing:.2px}
.nav{display:flex;align-items:center;gap:10px}
.navlink{padding:8px 10px;border-radius:12px;color:var(--muted)}
.navlink:hover{background:rgba(27,42,74,.35);color:var(--text)}

.footer{padding:18px;text-align:center;color:rgba(154,167,198,.7)}
.footerShell{margin-top:auto;border-top:1px solid rgba(27,42,74,.55)}

.card{
  background: linear-gradient(180deg, rgba(11,18,36,.85), rgba(11,18,36,.55));
  border: 1px solid rgba(27,42,74,.85);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding:18px;
}

.grid{display:grid;gap:16px}
.grid.two{grid-template-columns:1fr;}
@media (min-width: 920px){ .grid.two{grid-template-columns:1fr 1fr;} }

.pagehead{display:flex;align-items:flex-end;justify-content:space-between;gap:14px;margin:10px 0 16px}
.actions{display:flex;gap:10px;flex-wrap:wrap}

.h1{margin:0 0 6px;font-size:32px;letter-spacing:-.4px}
.h2{margin:0 0 12px;font-size:18px;color:rgba(232,236,255,.92)}
.h3{margin:12px 0 8px;font-size:14px;color:rgba(232,236,255,.86)}
.muted{margin:0;color:var(--muted)}
.small{font-size:12px}

.code{
  display:block;
  margin:8px 0;
  padding:10px 12px;
  border-radius:14px;
  background: rgba(27,42,74,.28);
  border: 1px solid rgba(27,42,74,.75);
  color: rgba(232,236,255,.92);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 12px;
}

.apiBlock{padding:12px 0}
.apiTitle{font-weight:800}
.spacer{height:10px}

.btn{
  appearance:none;border:none;cursor:pointer;
  border-radius: 14px;
  padding:10px 14px;
  font-weight:700;
  background: linear-gradient(135deg, rgba(90,163,255,.28), rgba(88,209,201,.22));
  color: var(--text);
  border: 1px solid rgba(27,42,74,.9);
}
.btn:hover{filter:brightness(1.08)}
.btn.ghost{background:rgba(27,42,74,.25)}
.btn.danger{background:rgba(255,92,92,.18);border-color:rgba(255,92,92,.35)}
.inline{display:inline}

.form{display:grid;gap:10px}
.label{color:rgba(154,167,198,.95);font-weight:700;font-size:13px}
.input,.textarea{
  background: rgba(6,10,20,.45);
  border:1px solid rgba(27,42,74,.9);
  border-radius: 14px;
  color: var(--text);
  padding:10px 12px;
  outline:none;
}
.input:focus,.textarea:focus{border-color:rgba(88,209,201,.55);box-shadow:0 0 0 4px rgba(88,209,201,.10)}
.textarea{resize:vertical;min-height:120px}

.alert{margin:10px 0;padding:12px 12px;border-radius:14px;background:rgba(27,42,74,.25);border:1px solid rgba(27,42,74,.75);color:var(--muted)}
.alert.danger{background:rgba(255,92,92,.14);border-color:rgba(255,92,92,.35);color:rgba(255,210,210,.95)}

.list{display:flex;flex-direction:column;gap:10px}

/*
  Many pages render long lists inside a .card (eg. Staff, Queue, Tickets).
  Without an internal scroll area, the entire page becomes the scroll container.
  Give lists inside cards a max height and scroll internally so the layout feels
  like a proper panel.
*/
.card .list{
  max-height: min(72vh, calc(100vh - 260px));
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 6px; /* keeps content off the scrollbar */
  scrollbar-gutter: stable;
  overscroll-behavior: contain;
}

/* If a page needs a full-height list, it can opt-out by adding .noCardScroll */
.noCardScroll .card .list{max-height:none;overflow:visible;padding-right:0}
.row{
  display:flex;align-items:center;justify-content:space-between;gap:12px;
  padding:12px 12px;
  border-radius:16px;
  border:1px solid rgba(27,42,74,.75);
  background: rgba(6,10,20,.35);
}
.row:hover{background: rgba(6,10,20,.45)}
.rowtitle{font-weight:800}
.rowmeta{color:rgba(154,167,198,.8);font-size:12.5px;margin-top:4px}

.pill{display:inline-flex;align-items:center;gap:6px;padding:6px 10px;border-radius:999px;font-weight:800;
  border:1px solid rgba(27,42,74,.9);background:rgba(27,42,74,.25);color:rgba(232,236,255,.92);text-transform:capitalize
}
.pill.ok{border-color:rgba(88,209,201,.5);background:rgba(88,209,201,.12);}
.pill.bad{border-color:rgba(255,92,92,.5);background:rgba(255,92,92,.12);}

.hr{border:none;border-top:1px solid rgba(27,42,74,.7);margin:14px 0}
.divider{border:none;border-top:1px solid rgba(27,42,74,.7);margin:14px 0}

.thread{display:flex;flex-direction:column;gap:12px}
.msg{border:1px solid rgba(27,42,74,.7);border-radius:16px;background:rgba(6,10,20,.32);padding:12px}
.msghead{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:8px}
.msguser{font-weight:900}
.msgtime{font-size:12px;color:rgba(154,167,198,.75)}
.msgbody{white-space:pre-wrap;line-height:1.35}

.bubble{border:1px solid rgba(27,42,74,.65);background:rgba(6,10,20,.28);border-radius:16px;padding:12px;line-height:1.35;white-space:pre-wrap}

.gallery{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin-top:10px}
@media (min-width: 920px){ .gallery{grid-template-columns:repeat(4,1fr);} }
.thumb{display:block;border-radius:16px;overflow:hidden;border:1px solid rgba(27,42,74,.75);background:rgba(6,10,20,.35)}
.thumb img{width:100%;height:100%;object-fit:cover;display:block;aspect-ratio:1/1}

.card.inner{padding:14px;border-radius:16px;background:rgba(6,10,20,.22);border:1px solid rgba(27,42,74,.65);box-shadow:none}

.kv{display:flex;flex-direction:column;gap:8px}
.kvrow{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:10px;border:1px solid rgba(27,42,74,.65);border-radius:14px;background:rgba(6,10,20,.28)}
.k{color:rgba(154,167,198,.85);font-weight:800;font-size:12.5px}
.v{font-weight:800}

.seg{display:flex;gap:10px;flex-wrap:wrap}
.segitem{display:flex;align-items:center;gap:8px;padding:10px 12px;border-radius:14px;border:1px solid rgba(27,42,74,.8);background:rgba(6,10,20,.30)}


/* Global update banner */
.updateBannerSpacer { height: 48px; }
.updateBanner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10000;
  backdrop-filter: blur(10px);
  background: rgba(17, 24, 39, 0.86);
  border-bottom: 1px solid rgba(255,255,255,0.10);
}
.updateBannerInner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.updateBannerText {
  font-weight: 600;
  letter-spacing: 0.2px;
}


/* File inputs: keep consistent sizing */
input[type="file"].input { padding: 8px 10px; }


/* Public pages header row */
.publicTopNav .btn { white-space: nowrap; }


/* Simple modal */
.tpModal { position: fixed; inset: 0; z-index: 9999; }
.tpModalBackdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.65); backdrop-filter: blur(2px); }
.tpModalDialog { position: relative; max-width: 520px; margin: 10vh auto; padding: 18px; }
@media (max-width: 640px) {
  .tpModalDialog { margin: 8vh 14px; }
}
