/* Same dark look as the app (owner palette, primary #7231BF), laid out for a computer screen. */
:root { --bg: #0A0619; --surface: #141029; --raised: #1C1638; --border: #2A2150; --text: #F5F2FF; --muted: #A99FC9; --primary: #7231BF; --soft: #B58AF2; --alert: #E5AE2B; --good: #52C987; --bad: #FF7A6E; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { color-scheme: dark; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.5 system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; }
h1 { font-size: 22px; margin: 0; letter-spacing: -.01em; }
h2 { font-size: 12px; margin: 28px 0 10px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .07em; }
h3 { font-size: 15px; margin: 0; }
p { margin: 6px 0; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.center { text-align: center; margin-top: 20vh; }
.error { color: var(--bad); }

button { font: inherit; font-weight: 600; border-radius: 10px; border: 1px solid transparent; padding: 8px 14px; cursor: pointer; background: var(--primary); color: #fff; transition: filter .15s, border-color .15s; }
button:hover { filter: brightness(1.12); }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible { outline: 2px solid var(--soft); outline-offset: 2px; }
button.quiet { background: transparent; border-color: var(--border); color: var(--text); }
button.quiet:hover { border-color: var(--soft); }
button.danger { background: #A8321F; }
button.link { background: none; color: var(--soft); padding-left: 0; margin-right: auto; }
button.wide { width: 100%; margin-top: 18px; padding: 11px; }
button:disabled { opacity: .4; cursor: not-allowed; filter: none; }

label { display: block; font-size: 12.5px; color: var(--muted); margin-top: 12px; }
input, textarea { display: block; width: 100%; margin-top: 4px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--bg); color: var(--text); font: inherit; font-size: 14px; resize: vertical; }
input.code { letter-spacing: .4em; text-align: center; font-size: 22px; }

/* sign-in */
.signin { max-width: 390px; margin: 9vh auto; padding: 28px; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; }
.signin .logo { display: block; width: 112px; margin: 0 auto 10px; }
.qr { display: block; width: 200px; height: 200px; margin: 12px auto; background: #fff; padding: 8px; border-radius: 12px; }
.secret { font-family: ui-monospace, Consolas, monospace; overflow-wrap: anywhere; background: var(--bg); border-radius: 8px; padding: 8px; font-size: 13px; user-select: all; }

/* frame */
.app { display: grid; grid-template-columns: 228px 1fr; min-height: 100vh; }
aside { position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; gap: 18px; padding: 18px 12px; background: var(--surface); border-right: 1px solid var(--border); }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 8px; font-weight: 800; font-size: 17px; }
.brand img { width: 34px; }
nav { display: flex; flex-direction: column; gap: 3px; }
nav a { display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 10px; color: var(--muted); text-decoration: none; font-weight: 600; }
nav a:hover { background: var(--raised); color: var(--text); }
nav a[aria-current] { background: var(--primary); color: #fff; }
.icon { width: 17px; height: 17px; fill: currentColor; flex: none; }
.pill { margin-left: auto; min-width: 20px; padding: 0 6px; border-radius: 10px; background: var(--alert); color: #1a1204; font-size: 11.5px; font-weight: 800; text-align: center; }
.who { margin-top: auto; display: flex; flex-direction: column; gap: 8px; padding: 0 8px; color: var(--muted); overflow-wrap: anywhere; }
main { padding: 22px 28px 56px; min-width: 0; max-width: 1180px; width: 100%; }
.pagehead { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.content { transition: opacity .15s; margin-top: 6px; }
.content.busy { opacity: .5; pointer-events: none; }

/* overview */
.stats { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.stat { display: flex; flex-direction: column; align-items: flex-start; text-align: left; gap: 2px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; color: var(--text); font-weight: 400; }
button.stat:hover { border-color: var(--soft); filter: none; }
.stat .label, .stat .note { font-size: 12.5px; color: var(--muted); }
.stat .value { font-size: 26px; font-weight: 800; letter-spacing: -.02em; overflow-wrap: anywhere; }
.stat.attention { border-color: rgba(229, 174, 43, .6); }
.stat.attention .value { color: var(--alert); }
.bars { max-width: 560px; }
.bar { display: grid; grid-template-columns: 130px 1fr 36px; align-items: center; gap: 10px; padding: 4px 0; }
.bar strong { text-align: right; }
meter { width: 100%; height: 8px; appearance: none; -webkit-appearance: none; }
meter::-webkit-meter-bar { background: var(--raised); border: 0; border-radius: 6px; height: 8px; }
meter::-webkit-meter-optimum-value { background: var(--soft); border-radius: 6px; }
meter::-moz-meter-bar { background: var(--soft); }

/* lists and tables */
.list { display: grid; gap: 12px; margin-top: 14px; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 16px 18px; }
.head { display: flex; align-items: center; gap: 12px; }
.grow { flex: 1; min-width: 0; }
.avatar { width: 46px; height: 46px; border-radius: 50%; object-fit: cover; background: var(--primary); display: flex; align-items: center; justify-content: center; font-weight: 800; flex: none; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; }
.row.end { justify-content: flex-end; }
.sub { margin-top: 12px; padding-top: 6px; border-top: 1px solid var(--border); }
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px 18px; margin: 12px 0 0; }
.facts dt { font-size: 11.5px; color: var(--muted); }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.badge { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: 11.5px; font-weight: 700; border: 1px solid var(--border); color: var(--muted); white-space: nowrap; }
.badge.good { color: var(--good); border-color: rgba(82, 201, 135, .45); }
.badge.warn { color: var(--alert); border-color: rgba(229, 174, 43, .45); }
.badge.bad { color: var(--bad); border-color: rgba(255, 122, 110, .45); }
.table { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 11.5px; color: var(--muted); font-weight: 700; padding: 10px 14px; border-bottom: 1px solid var(--border); }
td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--raised); }
td:last-child { text-align: right; }
.empty { text-align: center; padding: 30px 16px; background: var(--surface); border: 1px dashed var(--border); border-radius: 14px; margin-top: 8px; }

.filters { display: grid; grid-template-columns: 1fr 190px; gap: 10px; margin-top: 10px; }
select { width: 100%; margin-top: 4px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--bg); color: var(--text); font: inherit; }
td .row.end { margin-top: 0; }

.group { margin: 12px 10px 2px; font-size: 10.5px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: #6f6496; }
.setting { display: flex; align-items: center; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.setting:last-child { border-bottom: 0; }
.setting .value { font-weight: 800; white-space: nowrap; }
.stars { color: var(--alert); white-space: nowrap; letter-spacing: 1px; }
.chat { max-height: 420px; overflow-y: auto; }
.chat p { overflow-wrap: anywhere; }
a { color: var(--soft); }
td button.link { padding: 0; }

/* pop-ups and messages */
.dialog { width: min(460px, calc(100vw - 32px)); padding: 20px 22px; background: var(--raised); color: var(--text); border: 1px solid var(--border); border-radius: 16px; }
.dialog::backdrop { background: rgba(3, 1, 10, .7); }
.dialog h2 { margin: 0 0 4px; font-size: 17px; color: var(--text); text-transform: none; letter-spacing: 0; }
.dialog .row { margin-top: 16px; }
.viewer { width: min(860px, calc(100vw - 32px)); }
.viewer img, .viewer video { display: block; max-width: 100%; max-height: 70vh; margin: 12px auto 0; border-radius: 10px; }
.toasts { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; max-width: min(380px, calc(100vw - 32px)); z-index: 10; }
.toast { padding: 11px 14px; border-radius: 12px; background: var(--raised); border: 1px solid var(--border); border-left: 4px solid var(--good); }
.toast.warn { border-left-color: var(--alert); }
.toast.bad { border-left-color: var(--bad); }

@media (max-width: 780px) {
  .app { grid-template-columns: 1fr; }
  .filters { grid-template-columns: 1fr; }
  .group { display: none; }
  .setting { flex-wrap: wrap; }
  aside { position: static; height: auto; gap: 10px; border-right: 0; border-bottom: 1px solid var(--border); padding: 12px; }
  nav { flex-direction: row; overflow-x: auto; }
  nav a { white-space: nowrap; }
  .who { margin-top: 0; flex-direction: row; align-items: center; justify-content: space-between; }
  main { padding: 16px 14px 48px; }
}
