/* staff / dashboard / admin app */
header.site { display: flex; align-items: center; gap: 16px; padding: 10px 16px; border-bottom: 1px solid var(--line); background: rgba(6, 10, 26, .75); position: sticky; top: 0; z-index: 20; backdrop-filter: blur(8px); }
header.site .logo { text-decoration: none; color: var(--text); display: flex; gap: 8px; align-items: baseline; }
header.site .logo .orb { color: var(--cyan); font-weight: 800; letter-spacing: .12em; }
header.site nav { display: flex; gap: 4px; margin-left: auto; overflow-x: auto; }
header.site nav a { color: var(--muted); text-decoration: none; padding: 8px 12px; border-radius: 10px; white-space: nowrap; }
header.site nav a.on { color: var(--text); background: var(--panel-2); box-shadow: inset 0 0 0 1px var(--line); }

/* ---------- staff */
.pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.pick { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; padding: 14px 10px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line); color: var(--text); text-decoration: none; font-size: .92rem; }
.pick.on { border-color: var(--c); box-shadow: 0 0 16px color-mix(in srgb, var(--c) 40%, transparent); }
.pick .planet { width: 54px; height: 54px; font-size: 1.6rem; }
.planet.sm { width: 46px; height: 46px; font-size: 1.4rem; flex: none; }
.staff { display: grid; gap: 16px; padding: 12px 16px 24px; max-width: 1280px; margin: 0 auto; }
.st-head { display: flex; gap: 12px; align-items: center; }
.st-head h1 { font-size: 1.25rem; margin: 0; }
.qr-box { background: #fff; border-radius: 22px; padding: 10px; width: min(100%, 62vh, 560px); margin: 12px auto 0; box-shadow: 0 0 0 6px rgba(34, 211, 238, .25), 0 0 50px rgba(34, 211, 238, .35); }
.qr-box svg { display: block; width: 100%; height: auto; }
.scan { font-size: 1.15rem; font-weight: 400; margin: 12px 0 0; }
.url { margin: 2px 0 0; word-break: break-all; }
.big-nums { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.big-nums .label, .hud .label { font-size: .85rem; color: var(--muted); }
.big-nums .big { font-size: clamp(2.6rem, 9vw, 4.4rem); font-weight: 800; color: #fff; line-height: 1.1; text-shadow: 0 0 22px rgba(34, 211, 238, .5); }
.num.mid { font-size: 1.6rem; font-weight: 600; }
tr.cur td { color: var(--cyan); }
.bump { animation: bump .6s ease; }
@keyframes bump { 30% { transform: scale(1.18); color: var(--gold); } }
@media (min-width: 900px) {
  .staff { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); align-items: start; }
  .qr-box { width: min(100%, 70vh); }
}

/* ---------- dashboard */
.dash { padding: 12px 16px 24px; max-width: 1600px; margin: 0 auto; }
.dash-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 12px; }
.dash-bar .chip { text-decoration: none; min-height: 36px; padding: 6px 14px; }
.widgets { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.widgets .panel + .panel { margin-top: 0; }
.w h2 { font-size: .95rem; font-weight: 400; color: var(--muted); }
.w-station_table, .w-hourly, .w-comments, .w-per_day, .w-solar { grid-column: 1 / -1; }
.num.xl { font-size: 3rem; font-weight: 800; line-height: 1.1; color: #fff; text-shadow: 0 0 22px rgba(34, 211, 238, .45); }
.num.xl small { font-size: .5em; }
.sub { margin-top: 4px; }
.odo { display: inline-flex; line-height: 1; height: 1em; overflow: hidden; }
.odo.num { font-weight: 800; }
.odo, .odo * { text-shadow: none !important; }
.od { display: inline-block; height: 1em; overflow: hidden; }
.ods { display: flex; flex-direction: column; transition: transform 1.4s cubic-bezier(.2, .9, .25, 1); }
.ods span { height: 1em; line-height: 1em; }
.od-sep { display: inline-block; }
.ring-box { position: relative; width: 200px; max-width: 100%; margin: 0 auto; }
.ring { width: 100%; height: auto; display: block; }
.ring-in { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.ring-in .odo { font-size: 2.3rem; justify-content: center; color: #fff; }
.days { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.day { padding: 12px; border-radius: 14px; border: 1px solid var(--line); background: rgba(6, 10, 26, .5); }
.day.on { border-color: var(--cyan); box-shadow: var(--glow); }
.day .big { font-size: 2rem; font-weight: 800; }
.tbl-wrap { overflow-x: auto; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; box-shadow: 0 0 8px currentColor; }
tr.off { opacity: .45; }
.rchip { display: inline-block; padding: 1px 8px; margin: 2px 4px 2px 0; border-radius: 99px; border: 1px solid var(--line); font-family: var(--font-num); font-size: .72rem; }
.rchip.on { border-color: var(--cyan); color: var(--cyan); }
.chart { width: 100%; height: auto; display: block; margin-top: 8px; }
.svg-lbl { fill: var(--muted); font: 300 11px var(--font); }
.svg-num { fill: var(--text); font: 600 11px var(--font-num); }
.small-chips .chip { min-height: 32px; padding: 4px 12px; font-size: .85rem; }
.hbars { display: grid; gap: 8px; }
.hb { display: grid; grid-template-columns: minmax(90px, 40%) 1fr auto; gap: 8px; align-items: center; font-size: .88rem; }
.hb-l { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hb-b { height: 12px; border-radius: 99px; background: rgba(148, 163, 200, .15); overflow: hidden; }
.hb-b i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--blue), var(--cyan)); transition: width .8s; }
.hb-v { min-width: 3ch; text-align: right; font-size: .85rem; }
.cap + .cap { margin-top: 10px; }
.cap .bar { margin-top: 4px; }
.lb { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.lb li { display: flex; gap: 10px; align-items: center; padding: 6px 10px; border-radius: 10px; background: rgba(6, 10, 26, .45); }
.lb .rank { width: 1.8em; height: 1.8em; display: grid; place-items: center; border-radius: 50%; background: var(--panel-2); font-size: .8rem; }
.lb li:nth-child(1) .rank { background: var(--gold); color: #1a1000; }
.lb li:nth-child(2) .rank { background: #cbd5e1; color: #111; }
.lb li:nth-child(3) .rank { background: #d97706; color: #fff; }
.cmts { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.cmts blockquote { margin: 0; padding: 12px 14px; border-radius: 14px; background: rgba(6, 10, 26, .5); border-left: 3px solid var(--cyan); }
.cmts cite { display: block; margin-top: 6px; font-size: .8rem; color: var(--muted); font-style: normal; }
.solar-wrap { position: relative; height: min(70vh, 680px); }
canvas.solar { width: 100%; height: 100%; display: block; }
.hud { position: absolute; top: 4px; left: 4px; display: grid; gap: 10px; pointer-events: none; }
.hud .odo { font-size: 2.4rem; color: #fff; text-shadow: 0 0 18px rgba(34, 211, 238, .55); }
.hud .odo.sm { font-size: 1.4rem; }

/* big screen (projector 1920×1080): mission control */
body.dash-big header.site { display: none; }
.dash.big { max-width: none; height: 100vh; display: flex; flex-direction: column; padding: 14px 20px; }
.dash.big .mc { display: flex; flex-direction: column; margin-right: auto; }
.dash.big .mc .orb { font-size: 1.5rem; font-weight: 800; color: var(--cyan); letter-spacing: .14em; text-shadow: 0 0 16px rgba(34, 211, 238, .6); }
.dash.big .widgets { flex: 1; min-height: 0; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: minmax(0, 1fr); grid-auto-flow: dense; }
.dash.big .w { overflow: hidden; display: flex; flex-direction: column; }
.dash.big .w-body { flex: 1; min-height: 0; overflow: hidden; }
.dash.big .w-solar { grid-column: 1 / span 3; grid-row: span 3; }
.dash.big .w-solar .solar-wrap { height: 100%; }
.dash.big .w-station_table, .dash.big .w-hourly, .dash.big .w-per_day, .dash.big .w-comments { grid-column: span 2; }
.dash.big .num.xl { font-size: clamp(2.4rem, 3.4vw, 4.4rem); }
.dash.big .ring-box { width: min(100%, 17vh); }
.dash.big .hud .odo { font-size: clamp(2.4rem, 4.6vw, 5.4rem); }
.dash.big .hud .odo.sm { font-size: clamp(1.4rem, 2.2vw, 2.6rem); }
@media (max-width: 1000px) {
  .dash.big { height: auto; }
  .dash.big .widgets { grid-template-columns: 1fr; grid-auto-rows: auto; }
  .dash.big .w-solar, .dash.big .w-station_table, .dash.big .w-hourly, .dash.big .w-per_day, .dash.big .w-comments { grid-column: auto; grid-row: auto; }
  .dash.big .w-solar .solar-wrap { height: 60vh; }
}

/* ---------- admin */
.tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 12px; }
.tabs .chip { white-space: nowrap; }
.adm-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 430px), 1fr)); }
.adm-grid .panel + .panel { margin-top: 0; }
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; }
.rounds-tbl input { min-height: 36px; padding: 4px 6px; font-size: .85rem; }
.rounds-tbl input[type=time] { min-width: 96px; }
.rounds-tbl td { padding: 4px; }
.q-item { border: 1px solid var(--line); border-radius: 14px; padding: 12px; background: rgba(6, 10, 26, .4); }
.q-item + .q-item { margin-top: 8px; }
.q-item.off { opacity: .55; }
.q-item summary { cursor: pointer; list-style: none; display: flex; gap: 8px; align-items: baseline; }
.q-item summary::-webkit-details-marker { display: none; }
.tag { font-family: var(--font-num); font-size: .7rem; padding: 2px 8px; border-radius: 99px; border: 1px solid var(--line); color: var(--elec); white-space: nowrap; }
.w-pick { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 10px; background: rgba(6, 10, 26, .45); }
.w-pick + .w-pick { margin-top: 4px; }
.w-pick input { width: auto; min-height: 0; }
.cmt-item { display: flex; gap: 10px; align-items: flex-start; padding: 10px; border-bottom: 1px solid rgba(96, 165, 250, .14); }
.cards-prev { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; align-items: start; }
.cards-prev canvas { width: 100%; height: auto; border-radius: 12px; border: 1px solid var(--line); }

/* ---------- printable report (A4) */
.report-doc { background: #fff; color: #111; font-family: 'Kanit', 'Sarabun', sans-serif; font-weight: 300; padding: 18mm 16mm; max-width: 210mm; margin: 0 auto; border-radius: 6px; line-height: 1.5; }
.report-doc h1 { font-size: 18pt; text-align: center; margin-bottom: 2mm; font-weight: 600; }
.report-doc h2 { font-size: 14pt; margin: 7mm 0 2mm; font-weight: 600; }
.report-doc h3 { font-size: 12pt; margin: 5mm 0 2mm; font-weight: 600; }
.report-doc p, .report-doc td, .report-doc th { font-size: 11pt; }
.report-doc .sub { text-align: center; color: #333; }
.report-doc table { border-collapse: collapse; width: 100%; margin: 2mm 0 4mm; page-break-inside: auto; }
.report-doc tr { page-break-inside: avoid; }
.report-doc th, .report-doc td { border: 1px solid #555; padding: 1.5mm 2mm; color: #111; }
.report-doc th { background: #eef2f7; font-weight: 400; color: #111; text-align: center; }
.report-doc td.n { text-align: right; font-family: 'Kanit', sans-serif; }
.report-doc .note { font-size: 9.5pt; color: #444; }
.report-doc .sign { margin-top: 16mm; display: grid; grid-template-columns: 1fr 1fr; gap: 10mm; text-align: center; }
@media print {
  @page { size: A4; margin: 0; }
  body { background: #fff !important; }
  body::before, body::after, header.site, .no-print, .toast { display: none !important; }
  .report-doc { padding: 16mm 15mm; border-radius: 0; max-width: none; }
  .report-doc h2 { page-break-after: avoid; }
  body * { visibility: hidden; }
  .report-doc, .report-doc * { visibility: visible; }
  .report-doc { position: absolute; left: 0; top: 0; width: 100%; }
}
