/* Gewei admin dashboard: builds on style.css (colours, buttons, top bar, account menu, sign-in mark). */
.dash { max-width: 1240px; margin: 0 auto; padding: 32px 24px 80px; }
.board-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.board-head h1 { font-size: 30px; letter-spacing: -.03em; line-height: 1.1; }
.board-head .hint { margin-top: 4px; }
.range { width: min(420px, 100%); }
.range button { height: 32px; font-size: 13px; }

.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 14px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 18px 20px; min-width: 0; }
.kpi span { font-size: 13px; color: var(--soft); }
.kpi b { display: block; font-size: 30px; font-weight: 650; letter-spacing: -.03em; margin: 6px 0 2px; font-variant-numeric: tabular-nums; }
.kpi small { display: block; color: var(--faint); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.dash .card { padding: 20px; border-radius: 18px; box-shadow: none; margin-bottom: 14px; min-width: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.dash .card h3 { font-size: 15px; font-weight: 650; display: flex; align-items: center; gap: 8px; }
.trio .card h3 { margin-bottom: 14px; }
.legend { display: flex; gap: 14px; font-size: 13px; color: var(--soft); }
.lg::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.lg.people::before { background: var(--text); }
.lg.videos::before { background: var(--accent); }

.chart { height: 230px; }
.chart svg { display: block; width: 100%; height: 100%; overflow: visible; stroke: none; fill: none; stroke-width: 1; }
.chart .gl { stroke: var(--line); stroke-dasharray: 3 4; }
.chart .gl.base { stroke: var(--line-strong); stroke-dasharray: none; }
.chart text { fill: var(--faint); font: 11px var(--font); }
.chart .p { fill: var(--text); }
.chart .v { fill: var(--accent); }
.chart .hit { fill: transparent; }
.chart .col:hover .hit { fill: var(--sunken); }

.trio { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.bars { display: flex; flex-direction: column; gap: 12px; }
.bar-row { display: grid; grid-template-columns: 1fr auto; gap: 5px 10px; font-size: 13.5px; }
.bar-row > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-row > span:nth-child(2) { color: var(--soft); font-variant-numeric: tabular-nums; }
.bar-row i { grid-column: 1 / -1; height: 6px; border-radius: 999px; background: var(--sunken); overflow: hidden; }
.bar-row i b { display: block; height: 100%; background: var(--text); border-radius: inherit; }

.table-card { padding: 0 !important; overflow: hidden; }
.table-card .card-head { padding: 16px 20px 2px; }
.table-card input[type=search] { max-width: 300px; height: 36px; padding: 6px 12px; font-size: 14px; }
.table-wrap { overflow-x: auto; }
table.grid { width: 100%; border-collapse: collapse; font-size: 14px; }
table.grid th { text-align: left; font-weight: 500; color: var(--faint); font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em;
  padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.grid td { padding: 11px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; vertical-align: middle; }
table.grid th:first-child, table.grid td:first-child { padding-left: 20px; }
table.grid th:last-child, table.grid td:last-child { padding-right: 20px; }
table.grid tr:last-child td { border-bottom: 0; }
table.grid tr.click { cursor: pointer; }
table.grid tr.click:hover td { background: var(--sunken); }
table.grid .n { text-align: right; font-variant-numeric: tabular-nums; }
.who { display: flex; align-items: center; gap: 10px; min-width: 190px; }
.who > div { display: flex; flex-direction: column; min-width: 0; }
.who b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; max-width: 240px; }
.who small, .cell-sub { color: var(--faint); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; max-width: 260px; display: block; }
.av { width: 32px; height: 32px; border-radius: 50%; flex: none; display: grid; place-items: center; background: var(--sunken);
  color: var(--faint); font-weight: 650; font-size: 13px; overflow: hidden; object-fit: cover; }
.av svg { width: 16px; height: 16px; }
.av.user { background: var(--accent-soft); color: var(--accent); }
.av.big { width: 56px; height: 56px; font-size: 20px; }
.av.big svg { width: 24px; height: 24px; }
.tag { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; padding: 2px 8px; border-radius: 999px; background: var(--sunken); color: var(--soft); white-space: nowrap; }
.tag.warn { background: color-mix(in srgb, var(--warn) 14%, transparent); color: var(--warn); }
.tag.good { background: color-mix(in srgb, var(--good) 14%, transparent); color: var(--good); }
.badge.error { background: color-mix(in srgb, var(--bad) 12%, transparent); color: var(--bad); }
.badge.busy, .badge.unknown { background: var(--sunken); color: var(--soft); }
.muted { color: var(--faint); }
.st { display: inline-flex; flex-direction: column; align-items: flex-start; gap: 3px; }
.vid-top .st { flex-direction: row; align-items: center; gap: 8px; flex: none; }
.bad-text { color: var(--bad); }
.more { display: flex; justify-content: center; padding: 12px; border-top: 1px solid var(--line); }
.more:empty { display: none; }
.empty { padding: 30px 20px; color: var(--faint); text-align: center; font-size: 14px; }
.watch { height: 30px; padding: 0 12px; font-size: 13px; }
.watch svg { width: 14px; height: 14px; fill: currentColor; stroke: none; }

/* sign-in gate */
.gate { display: grid; place-items: center; min-height: calc(100vh - 220px); }
.gate .card { width: min(420px, 100%); text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 40px 28px 30px !important; box-shadow: var(--shadow) !important; }
.gate h2 { font-size: 22px; letter-spacing: -.02em; }
.gate .sub { color: var(--soft); max-width: 320px; }
.gate .err-text:empty { display: none; }
.gate .gsi:empty { display: none; }
.gate .card.wide { width: min(600px, 100%); }
.setup { width: 100%; text-align: left; }
.setup-steps { margin: 6px 0 16px; padding-left: 22px; display: flex; flex-direction: column; gap: 12px; font-size: 14px; color: var(--soft); }
.setup-steps li::marker { color: var(--accent); font-weight: 700; }
.setup-steps a { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
.setup-steps b { color: var(--text); font-weight: 600; }
.origins { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.origins code { font: 12.5px var(--mono); background: var(--sunken); border: 1px solid var(--line); border-radius: 8px; padding: 3px 8px; color: var(--text); }
.setup-form { display: flex; flex-direction: column; gap: 10px; }

/* person sheet */
.sheet { position: fixed; top: 0; right: 0; bottom: 0; width: min(500px, 100vw); background: var(--surface); border-left: 1px solid var(--line);
  box-shadow: var(--shadow-lg); z-index: 50; transform: translateX(104%); transition: transform .25s ease; overflow-y: auto; }
body.sheet-open .sheet { transform: none; }
body.sheet-open .scrim { display: block; position: fixed; inset: 0; z-index: 45; background: rgba(10, 10, 12, .3); }
.sheet-head { position: sticky; top: 0; display: flex; justify-content: flex-end; padding: 10px; background: var(--surface); z-index: 1; }
.sheet-body { padding: 0 26px 40px; }
.p-head { display: flex; gap: 14px; align-items: center; margin-bottom: 14px; }
.p-head h2 { font-size: 21px; letter-spacing: -.02em; line-height: 1.2; }
.p-head p { color: var(--soft); font-size: 14px; }
.facts { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 18px; }
.facts .tag { font-size: 12.5px; padding: 4px 10px; }
.mini { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.mini div { background: var(--sunken); border-radius: 12px; padding: 10px 12px; }
.mini span { font-size: 12px; color: var(--faint); display: block; }
.mini b { font-size: 16px; font-variant-numeric: tabular-nums; }
.sheet h4 { font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); font-weight: 600; margin: 24px 0 10px; }
.vid { border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; margin-bottom: 8px; }
.vid-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.vid-top b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vid small { color: var(--faint); font-size: 12.5px; }
.vid q { display: block; font-size: 13px; color: var(--soft); margin-top: 6px; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 16px 1fr; gap: 8px; padding: 8px 0; font-size: 13.5px; border-bottom: 1px dashed var(--line); }
.timeline li:last-child { border-bottom: 0; }
.timeline li::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--line-strong); margin: 6px 0 0 2px; }
.timeline li.ev-job::before, .timeline li.ev-download::before { background: var(--accent); }
.timeline li.ev-signin::before { background: var(--good); }
.timeline li.ev-wall::before { background: var(--warn); }
.timeline small { display: block; color: var(--faint); font-size: 12px; }

/* video player */
dialog.video-dlg { padding: 0; border: 0; border-radius: 22px; background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg);
  width: min(400px, calc(100vw - 24px)); overflow: hidden; }
dialog.video-dlg::backdrop { background: rgba(10, 10, 12, .6); backdrop-filter: blur(4px); }
dialog.video-dlg form { position: relative; }
dialog.video-dlg video { display: block; width: 100%; aspect-ratio: 9 / 16; max-height: 68vh; background: #000; }
dialog.video-dlg .close { position: absolute; top: 10px; right: 10px; z-index: 2; background: rgba(0, 0, 0, .5); color: #fff; }
.dlg-meta { padding: 14px 18px 18px; font-size: 14px; display: flex; flex-direction: column; gap: 4px; }
.dlg-meta h3 { font-size: 16px; }
.dlg-meta q { color: var(--soft); font-size: 13px; }

@media (max-width: 1000px) {
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .trio { grid-template-columns: 1fr; gap: 0; }
}
@media (max-width: 640px) {
  .dash { padding: 20px 14px 60px; }
  .board-head { flex-direction: column; align-items: stretch; }
  .board-head h1 { font-size: 26px; }
  .kpi { padding: 14px 16px; }
  .kpi b { font-size: 24px; }
  .chart { height: 190px; }
  .table-card .card-head { flex-direction: column; align-items: stretch; }
  .table-card input[type=search] { max-width: none; }
  .sheet-body { padding: 0 18px 32px; }
  #editorLink { display: none; }
}
