/* Admin console. Loaded after /style.css and /activities/style.css, so it
   only adds what those don't already provide (.d-none, .page-head,
   .auth-widget, --muted/--border/--primary). */

.adm-scope { font-size: 12px; color: var(--muted); margin: 0 0 16px; line-height: 1.5; }
.adm-scope code { font-size: 11.5px; background: #f1f3f4; padding: 1px 5px; border-radius: 4px; }

/* Headline numbers. auto-fit + minmax keeps them on one row on a laptop and
   wraps to two per row on a phone without a media query. */
.adm-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 18px; }
.adm-card { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; min-width: 0; }
.adm-num { font-size: 24px; font-weight: 700; line-height: 1.1; }
.adm-lab { font-size: 11.5px; color: var(--muted); margin-top: 3px; }

.adm-panel { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 16px; margin-bottom: 18px; }
.adm-panel h2 { font-size: 14px; font-weight: 600; margin: 0 0 12px; }

/* Signup bars — plain CSS, no chart library to load or keep up to date. */
.adm-chart { display: flex; flex-direction: column; gap: 6px; }
.adm-bar-row { display: grid; grid-template-columns: 62px minmax(0, 1fr) 34px; align-items: center; gap: 10px; }
.adm-bar-lab { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.adm-bar { background: #f1f3f4; border-radius: 5px; height: 14px; overflow: hidden; min-width: 0; }
.adm-bar-fill { display: block; height: 100%; background: var(--primary); border-radius: 5px; }
.adm-bar-n { font-size: 11.5px; text-align: right; font-variant-numeric: tabular-nums; }

/* Tables can be wider than a phone. Scroll the container, never the page —
   same rule the calendars needed. */
.adm-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.adm-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.adm-table th { font-size: 11px; font-weight: 600; text-align: left; padding: 8px 10px; background: #f1f3f4; color: var(--muted); border-bottom: 1px solid var(--border); white-space: nowrap; }
.adm-table td { padding: 9px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
.adm-table td.num, .adm-table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.adm-table code { font-size: 11.5px; }
.adm-empty { color: var(--muted); text-align: center; padding: 18px 10px !important; }
.adm-detail { font-size: 11px; color: var(--muted); margin-top: 3px; word-break: break-word; }
.adm-ago { color: var(--muted); }
.adm-never { color: #b3261e; }
.adm-you { font-size: 10.5px; background: #eef0fb; color: var(--primary); border-radius: 4px; padding: 1px 5px; margin-left: 4px; }
.adm-admin { font-size: 10.5px; background: var(--primary); color: #fff; border-radius: 4px; padding: 2px 6px; font-weight: 600; white-space: nowrap; }
/* The action buttons carry short Chinese labels that were breaking mid-word
   ("設為管理 / 員") once the admin column made the row narrower. */
.adm-table td button { white-space: nowrap; }
.adm-note { font-size: 12px; color: #b3261e; margin: 0 0 10px; }
.adm-note:empty { display: none; }

.adm-toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.adm-toolbar input[type="search"] { border: 1px solid var(--border); border-radius: 8px; padding: 7px 10px; font-size: 12.5px; min-width: 180px; flex: 1 1 180px; }
.adm-check { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.adm-count { font-size: 11.5px; color: var(--muted); margin-left: auto; font-variant-numeric: tabular-nums; }

/* Buttons — not defined in the shared sheets, so they live here. */
.btn-ghost { border: 1px solid var(--border); background: #fff; color: var(--muted); border-radius: 8px; padding: 7px 12px; font-size: 12.5px; cursor: pointer; }
.btn-ghost:hover { background: #f1f3f4; }
.btn-danger { border: 1px solid #f8c7d2; background: #fde8ec; color: #b3261e; border-radius: 8px; padding: 7px 12px; font-size: 12.5px; cursor: pointer; }
.btn-danger:hover:not(:disabled) { background: #f8c7d2; }
.btn-danger:disabled { opacity: .5; cursor: not-allowed; }
.btn-ghost.sm, .btn-danger.sm { padding: 5px 10px; font-size: 11.5px; }
.auth-widget .who { color: var(--muted); }

.adm-denied { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 22px; margin: 20px 0; }
.adm-denied h2 { font-size: 15px; margin: 0 0 8px; }
.adm-denied p { font-size: 12.5px; color: var(--muted); line-height: 1.6; margin: 0 0 8px; }

.btn-primary { border: 1px solid var(--primary); background: var(--primary); color: #fff; border-radius: 8px; padding: 8px 14px; font-size: 12.5px; cursor: pointer; }
.btn-primary:hover:not(:disabled) { filter: brightness(1.06); }
.btn-primary:disabled { opacity: .5; cursor: not-allowed; }

/* --- Export / import page (/data) ---------------------------------------
   Shares this sheet because it uses the same .adm-panel shell. */
.io-help { font-size: 12.5px; color: var(--muted); line-height: 1.6; margin: 0 0 12px; }
.io-help code { background: #f1f3f4; padding: 1px 5px; border-radius: 4px; font-size: 11.5px; }
.io-picks { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 12px; }
.io-n, .io-none { color: var(--muted); font-size: 11.5px; }
.io-chip { display: inline-block; background: #f1f3f4; border-radius: 6px; padding: 3px 8px; margin: 0 6px 6px 0; font-size: 11.5px; }
.io-chip code { font-size: 11px; }
.adm-note-plain { font-size: 12.5px; color: var(--muted); }
.io-details { margin-top: 14px; font-size: 12.5px; }
.io-details summary { cursor: pointer; color: var(--primary); }
.io-details ul { margin: 10px 0 0; padding-left: 18px; line-height: 1.7; color: var(--muted); }
.io-details li { margin-bottom: 4px; }
.io-tip { color: var(--muted); margin: 10px 0 0; line-height: 1.6; }
.io-preview { margin: 12px 0; font-size: 12.5px; }
.io-from { color: var(--muted); font-size: 11.5px; margin-bottom: 6px; }
.io-log { margin-top: 12px; font-size: 12px; font-family: ui-monospace, Menlo, Consolas, monospace; }
.io-log .ok { color: #1a7f5a; }
.io-log .bad, .io-preview .bad { color: #b3261e; }
#file { font-size: 12.5px; margin-bottom: 6px; max-width: 100%; }

/* Confirm dialog */
.adm-overlay { position: fixed; inset: 0; background: rgba(11,15,25,.55); z-index: 2000; display: flex; align-items: center; justify-content: center; padding: 16px; }
.adm-modal { background: #fff; border-radius: 14px; max-width: 460px; width: 100%; padding: 22px; box-shadow: 0 1rem 3rem rgba(0,0,0,.25); }
.adm-modal h3 { font-size: 15px; margin: 0 0 10px; }
.adm-modal p { font-size: 12.5px; line-height: 1.6; margin: 0 0 10px; }
.adm-target { font-weight: 600; word-break: break-all; }
.adm-warn { color: #b3261e; }
.adm-modal input[type="text"] { width: 100%; border: 1px solid var(--border); border-radius: 8px; padding: 9px 11px; font-size: 13px; }
.adm-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }
.adm-error { color: #b3261e; font-size: 12px; margin-top: 10px; }
.adm-error:empty { display: none; }

/* --- Top-schools review panel (review.js) ------------------------------- */
.rv-summary { font-size: 12.5px; color: var(--muted); line-height: 1.55; margin: 0 0 12px; }
.rv-closed { border: 2px solid #b3261e; background: #fdeaec; border-radius: 8px; padding: 10px 14px; margin: 0 0 14px; }
.rv-closed ul { margin: 6px 0 0; padding-left: 20px; font-size: 12.5px; }
.rv-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0 0 12px; }
.rv-actions .rv-note { margin-left: auto; }
.rv-sm { padding: 6px 12px; font-size: 12px; }
.rv-cat { font-size: 14px; margin: 16px 0 6px; }
.rv-area { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin: 12px 0 4px; }
.rv-count { color: var(--muted); font-weight: 400; }
.rv-row { display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; margin-bottom: 6px; font-size: 13px; }
.rv-row.rv-pending { cursor: pointer; }
.rv-row.rv-pending:hover { background: #f7f7fc; border-color: var(--primary); }
.rv-row.rv-approved { background: #eefaf4; border-color: #b7e6d1; }
.rv-row.rv-tracked { background: #fafafa; color: var(--muted); }
.rv-pick { margin-right: 8px; accent-color: var(--primary); }
.rv-meta { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.rv-weak { color: #d08700; }
.rv-note { font-size: 11.5px; color: var(--muted); }

/* Scheduled jobs panel — what runs on a timer (schedules-panel.js). */
.sched-table td { vertical-align: top; }
.sched-group td { background: #f7f7fc; font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; padding: 7px 10px; }
.sched-name { font-weight: 600; }
.sched-what { font-size: 11.5px; color: var(--muted); margin-top: 2px; max-width: 46ch; }
.sched-when { white-space: nowrap; font-variant-numeric: tabular-nums; }
.sched-nextcell { font-variant-numeric: tabular-nums; }
.sched-actions { white-space: nowrap; text-align: right; }
.sched-manual { font-size: 11px; color: var(--muted); margin-top: 2px; }
.sched-foot { margin-top: 10px; }

@media (max-width: 640px) {
  /* The description is the long column; let it wrap rather than making the
     whole table scroll sideways on a phone. */
  .sched-what { max-width: none; }
  .sched-when, .sched-nextcell { white-space: normal; }
}
.sched-actions a { color: var(--primary); font-weight: 600; text-decoration: none; }
.sched-actions a:hover { text-decoration: underline; }

/* Calendar feed controls on /account. The URL is long and must be selectable
   in one gesture on a phone, so it lives in a real input rather than as text. */
.cal-toggle { display: flex; align-items: center; gap: 9px; font-size: 13px;
  font-weight: 600; cursor: pointer; margin: 4px 0 10px; }
.cal-toggle input { width: 17px; height: 17px; cursor: pointer; accent-color: var(--primary); }
.cal-urlrow { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.cal-urlrow input { flex: 1 1 240px; min-width: 0; font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 11.5px; padding: 7px 9px; border: 1px solid var(--border); border-radius: 8px;
  background: #f7f7fb; color: var(--text); }
/* "How do I add this?" — a <details> so the panel stays short for anyone who
   has already done it, without hiding the steps behind another page. */
.cal-how { margin-top: 14px; border-top: 1px solid var(--border); padding-top: 10px; }
.cal-how > summary { font-size: 12.5px; font-weight: 600; cursor: pointer; color: var(--primary); }
.cal-how h3 { font-size: 12.5px; margin: 14px 0 5px; }
.cal-how ol { margin: 0; padding-left: 18px; }
.cal-how li { font-size: 12.5px; color: var(--muted); line-height: 1.65; margin-bottom: 4px; }
.cal-how b { color: var(--text); }
.cal-warn, .cal-tip { font-size: 12.5px; line-height: 1.6; border-radius: 8px;
  padding: 9px 11px; margin: 10px 0 0; }
.cal-warn { background: #fff5f7; border: 1px solid #f7c6d1; color: var(--text); }
.cal-tip { background: #f1effe; color: var(--muted); }
.cal-tip b { color: var(--text); }
.cal-note { font-size: 12.5px; color: var(--muted); line-height: 1.6; margin: 0 0 6px; }

/* --- Top Schools list panel (toplist.js) ---------------------------------- */
/* Borrows the review panel's rv-* shapes above; these are only what a row that
   can be REMOVED, and a form that ADDS one, need beyond them. */
.tl-row { display: flex; align-items: center; justify-content: space-between; gap: 10px;
          padding: 8px 10px; border: 1px solid var(--border); border-radius: 10px; margin-bottom: 6px; }
.tl-name { font-size: 13px; line-height: 1.6; }
.tl-site { font-size: 11.5px; color: var(--primary); text-decoration: none; }
.tl-site:hover { text-decoration: underline; }
.tl-note { font-size: 11.5px; color: var(--muted); }
.tl-tag { font-size: 10.5px; border: 1px solid var(--border); border-radius: 10px;
          padding: 1px 7px; color: var(--muted); margin-left: 4px; white-space: nowrap; }
/* "details coming" is a state, not a fault: the nightly job has it in hand. */
.tl-tag.tl-thin { background: #fdf0d5; border-color: #e6cf9c; color: #8a6d3b; }
.tl-add { border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; margin-bottom: 14px;
          background: #fbfbfe; }
/* Wraps on a phone, one row on a laptop — the name fields want the room. */
.tl-fields { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.tl-fields input, .tl-fields select { font-size: 12px; padding: 6px 8px; border: 1px solid var(--border);
          border-radius: 8px; font-family: inherit; flex: 1 1 160px; min-width: 0; }
.tl-msg { font-size: 12px; color: var(--muted); margin-top: 8px; min-height: 1em; }
