/* BugBot Admin: the teacher app's colours, laid out for scanning numbers and lists */
:root {
  --bb-green: #adc276; --bb-green-dark: #8da45a; --bb-green-deep: #6f8544;
  --bb-dark: #111111; --bb-secondary: #5f6b57; --bb-sage: #bbd291; --bb-border: #c9d6aa;
  --bb-light-bg: #e2ecce; --bb-page: #f6f8f1; --bb-red: #b93c37; --bb-red-bg: #f7dcdb; --bb-amber-bg: #fbeec2; --bb-amber: #7a5a00;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: 'Nunito', system-ui, sans-serif; color: var(--bb-dark); background: var(--bb-page); line-height: 1.5; }
[hidden] { display: none !important; }
.bar { position: sticky; top: 0; z-index: 20; display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1.5rem; padding: .45rem 1.25rem; background: var(--bb-green); }
.brand { font-family: 'Varela Round', sans-serif; color: var(--bb-dark); text-decoration: none; display: flex; align-items: center; gap: .7rem; }
.brand .logo { height: 34px; width: auto; }
.brand .site { padding: .15rem .65rem; border-radius: 999px; background: #000; color: #fff; font-size: .85rem; font-weight: 700; }
.who { margin-left: auto; font-size: .85rem; font-weight: 700; }
.who button { margin-left: .6rem; }
/* the menu down the side, the page beside it; on a phone the menu scrolls across the top */
.shell { display: block; }
body.signed-in .shell { display: grid; grid-template-columns: 12.5rem minmax(0, 1fr); align-items: start; }
.side { position: sticky; top: 3.1rem; max-height: calc(100vh - 3.1rem); overflow-y: auto; padding: 1rem .6rem 2rem 1rem; border-right: 1px solid var(--bb-border); background: #fff; min-height: calc(100vh - 3.1rem); }
.nav-group { margin-bottom: .9rem; }
.nav-head { font-size: .68rem; letter-spacing: .08em; text-transform: uppercase; font-weight: 800; color: var(--bb-secondary); margin: 0 0 .25rem .5rem; }
.side a { display: block; padding: .28rem .5rem; border-radius: 6px; color: var(--bb-dark); text-decoration: none; font-weight: 600; font-size: .9rem; }
.side a:hover { background: var(--bb-page); }
.side a.on { background: var(--bb-light-bg); font-weight: 800; }
.nav-role { font-size: .75rem; color: var(--bb-secondary); margin: 1rem .5rem 0; }
.app { max-width: 1240px; margin: 0 auto; padding: 1.25rem 1.25rem 4rem; width: 100%; }
.app:focus { outline: none; }
.page-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: .5rem 1rem; }
@media (max-width: 800px) {
  body.signed-in .shell { display: block; }
  .side { position: static; min-height: 0; max-height: none; display: flex; gap: .2rem 1rem; overflow-x: auto; padding: .5rem 1rem; border-right: 0; border-bottom: 1px solid var(--bb-border); }
  .nav-group { display: flex; align-items: center; gap: .1rem; margin: 0; flex: 0 0 auto; }
  .nav-head, .nav-role { display: none; }
  .side a { white-space: nowrap; }
}
h1 { font-family: 'Varela Round', sans-serif; font-weight: 400; font-size: 1.7rem; margin: .4rem 0 .4rem; }
h2 { font-family: 'Varela Round', sans-serif; font-weight: 400; font-size: 1.25rem; margin: 1.8rem 0 .6rem; text-wrap: balance; }
h3 { font-size: 1rem; margin: 0 0 .4rem; }
p.lead { color: var(--bb-secondary); max-width: 70ch; margin-top: 0; }
a { color: var(--bb-green-deep); }
button, .btn { font: inherit; font-weight: 700; font-size: .88rem; padding: .35rem .9rem; border-radius: 6px; border: 1px solid var(--bb-green-dark); background: #fff; color: var(--bb-dark); cursor: pointer; text-decoration: none; display: inline-block; }
button.primary, .btn.primary { background: var(--bb-green); border-color: var(--bb-green); }
button.danger { border-color: var(--bb-red); color: var(--bb-red); }
button.small { font-size: .78rem; padding: .15rem .55rem; }
button:hover, .btn:hover { background: var(--bb-sage); color: var(--bb-dark); }
button:disabled { opacity: .5; cursor: default; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--bb-green-deep); outline-offset: 2px; }
input, select, textarea { font: inherit; font-size: .9rem; padding: .35rem .55rem; border: 1px solid var(--bb-border); border-radius: 6px; background: #fff; max-width: 100%; }
textarea { width: 100%; min-height: 12rem; line-height: 1.5; }
label { font-size: .82rem; font-weight: 700; color: var(--bb-secondary); display: block; margin-bottom: .15rem; }
.row { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }
.grow { flex: 1 1 14rem; }
.card { border: 1px solid var(--bb-border); border-radius: 10px; background: #fff; padding: 1rem 1.2rem; margin: .8rem 0; }
.note { color: var(--bb-secondary); font-size: .86rem; }
.err { color: var(--bb-red); }
.ok { color: var(--bb-green-deep); }
.num { font-variant-numeric: tabular-nums; text-align: right; }
.mono { font-family: 'Roboto Mono', monospace; font-size: .85rem; }

/* overview */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(12.5rem, 1fr)); gap: .8rem; }
.tile { background: #fff; border: 1px solid var(--bb-border); border-radius: 10px; padding: .8rem 1rem; }
.tile .k { font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; color: var(--bb-secondary); font-weight: 700; }
.tile .v { font-size: 1.9rem; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.2; }
.tile .d { font-size: .82rem; color: var(--bb-secondary); }
.charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr)); gap: .8rem; }
.chart { background: #fff; border: 1px solid var(--bb-border); border-radius: 10px; padding: .8rem 1rem; }
.chart svg { width: 100%; height: auto; display: block; }
.chart .axis { fill: var(--bb-secondary); font-size: 10px; font-family: 'Nunito', sans-serif; }
.chart .bar { fill: var(--bb-green-dark); }
.chart .bar.last { fill: var(--bb-green-deep); }
.chart .grid { stroke: #e5ead8; stroke-width: 1; }
.chart .lbl { fill: var(--bb-dark); font-size: 10px; font-weight: 700; font-family: 'Nunito', sans-serif; }
.split { display: grid; grid-template-columns: repeat(auto-fit, minmax(22rem, 1fr)); gap: .8rem; }

/* tables and lists */
table { border-collapse: collapse; width: 100%; font-size: .88rem; background: #fff; }
th, td { text-align: left; padding: .4rem .55rem; border-top: 1px solid var(--bb-border); vertical-align: top; }
thead th { font-size: .7rem; letter-spacing: .06em; text-transform: uppercase; color: var(--bb-secondary); border-top: 0; white-space: nowrap; }
.table-wrap { overflow-x: auto; border: 1px solid var(--bb-border); border-radius: 10px; background: #fff; }
tr.pick { cursor: pointer; }
tr.pick:hover td { background: var(--bb-page); }
tr.open td { background: var(--bb-light-bg); }
.pill { display: inline-block; padding: .05rem .5rem; border-radius: 999px; font-size: .75rem; font-weight: 700; background: #eee; color: var(--bb-secondary); white-space: nowrap; }
.pill.good { background: var(--bb-sage); color: var(--bb-dark); }
.pill.warn { background: var(--bb-amber-bg); color: var(--bb-amber); }
.pill.bad { background: var(--bb-red-bg); color: var(--bb-red); }
.filters { display: flex; flex-wrap: wrap; gap: .5rem; align-items: end; margin: .6rem 0 .8rem; }
.fb { background: #fff; border: 1px solid var(--bb-border); border-left: 4px solid var(--bb-border); border-radius: 8px; padding: .7rem .9rem; margin: .5rem 0; }
.fb.no { border-left-color: var(--bb-red); }
.fb.mostly { border-left-color: #d9b44a; }
.fb.yes { border-left-color: var(--bb-green-dark); }
.fb.done, .fb.ignored { opacity: .6; }
.fb .meta { font-size: .8rem; color: var(--bb-secondary); }
.fb .text { margin: .35rem 0; white-space: pre-wrap; }
.fb .note-in { width: 100%; margin-top: .3rem; }
.panel { background: #fff; border: 1px solid var(--bb-green-dark); border-radius: 10px; padding: 1rem 1.2rem; margin: .5rem 0 1rem; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); gap: .7rem; }
.post-preview { border: 1px dashed var(--bb-border); border-radius: 8px; padding: .8rem 1rem; background: #fff; }
.post-preview time { font-size: .75rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--bb-green-deep); }
.toast { position: fixed; bottom: 1rem; left: 50%; transform: translateX(-50%); background: #000; color: #fff; padding: .5rem 1rem; border-radius: 8px; font-weight: 700; font-size: .9rem; z-index: 50; }
.signin { max-width: 26rem; }
.signin button { width: 100%; margin: .3rem 0; }
.signin input { width: 100%; margin: 0 0 .5rem; }
.signin label { margin-top: .3rem; }
.list-row { display: flex; flex-wrap: wrap; gap: .3rem .8rem; align-items: baseline; padding: .45rem 0; border-top: 1px solid var(--bb-border); }
.list-row:first-child { border-top: 0; }
.alert-group { margin-bottom: 1rem; }
.timeline { list-style: none; padding: 0; margin: .4rem 0; }
.timeline li { padding: .35rem 0; border-top: 1px solid var(--bb-border); font-size: .88rem; }
.qr { background: #fff; padding: .5rem; display: inline-block; border: 1px solid var(--bb-border); border-radius: 8px; }
.danger-zone { border-color: var(--bb-red); }
@media (max-width: 640px) { .who { margin-left: 0; } .tile .v { font-size: 1.5rem; } }
/* a printed invoice */
.invoice { background: #fff; border: 1px solid var(--bb-border); border-radius: 10px; padding: 2rem 2.2rem; max-width: 48rem; }
.inv-top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem 2rem; margin-bottom: 1.6rem; }
.inv-from { text-align: right; }
.invoice table { margin: 1rem 0 1.5rem; }
.inv-total td { font-weight: 800; }
.inv-pay { white-space: pre-wrap; background: var(--bb-page); padding: .8rem 1rem; border-radius: 8px; }
@media print {
  .invoice { border: 0; padding: 0; max-width: none; }
  .bar, .no-print { display: none !important; }
  body { background: #fff; }
}
