/* ============================ Platform pages (superadmin) ============================ */
.admin-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); }
.admin-toolbar .control { width: auto; margin-top: 0; }
.admin-toolbar__search { flex: 1 1 240px; }
.admin-toolbar__search .control { width: 100%; }
.admin-toolbar__end { margin-left: auto; }

.admin-grid { display: grid; gap: var(--space-6); grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
.admin-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 1100px) { .admin-grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 820px) { .admin-grid, .admin-grid--3 { grid-template-columns: minmax(0, 1fr); } }

/* Daily bars: a thin mark per day on one baseline, with the top of the scale marked. */
.trend { position: relative; padding-top: var(--space-5); }
.trend__max { position: absolute; top: 0; left: 0; font-size: 12px; color: var(--ink-muted); font-variant-numeric: tabular-nums; }
.trend__plot { display: flex; align-items: stretch; gap: 2px; height: 140px; border-top: 1px dashed var(--border-hairline); border-bottom: 1px solid var(--border-control); }
.trend__col { position: relative; flex: 1 1 0; min-width: 0; display: flex; align-items: flex-end; justify-content: center; }
.trend__col:hover { background: var(--surface-sunken); }
.trend__bar { display: block; width: 100%; max-width: 14px; border-radius: 4px 4px 0 0; background: var(--primary); }
.trend__tip {
  position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); z-index: 2;
  white-space: nowrap; font-size: 12px; line-height: 18px; color: var(--ink); background: var(--surface-card);
  border: 1px solid var(--border-hairline); border-radius: 6px; padding: 2px 8px; box-shadow: var(--shadow-raised);
  opacity: 0; pointer-events: none; transition: opacity 100ms ease;
}
.trend__tip strong { font-weight: 600; }
.trend__col:hover .trend__tip { opacity: 1; }
.trend__col:first-child .trend__tip { left: 0; transform: none; }
.trend__col:last-child .trend__tip { left: auto; right: 0; transform: none; }
.trend__x { display: flex; justify-content: space-between; margin-top: var(--space-2); font-size: 12px; color: var(--ink-muted); }

.rank--wide .rank__row { grid-template-columns: minmax(0, 1fr) 72px; }

.admin-facts { display: grid; gap: var(--space-3); margin: 0; }
.admin-facts > div { display: flex; justify-content: space-between; gap: var(--space-4); font-size: 14px; }
.admin-facts dt { color: var(--ink-muted); }
.admin-facts dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }

.admin-table summary { cursor: pointer; font-size: 14px; font-weight: 600; color: var(--primary-ink); }
.admin-table .tablewrap { margin-top: var(--space-4); max-height: 420px; overflow-y: auto; }
.admin-num { text-align: right !important; font-variant-numeric: tabular-nums; }

/* Status words always carry their meaning in text; colour only backs it up. */
.admin-pill { display: inline-block; font-size: 12px; line-height: 18px; font-weight: 600; padding: 1px 8px; border-radius: var(--radius-pill); background: var(--slate-soft); color: var(--slate); white-space: nowrap; }
.admin-pill--super { background: var(--primary-soft); color: var(--primary-ink); }
.admin-pill--blocked { background: var(--danger); color: #fff; }
.admin-pills { display: flex; flex-wrap: wrap; gap: var(--space-1); }

.admin-pager { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); margin-top: var(--space-4); }
.admin-back { margin-bottom: var(--space-4); }

.admin-who { display: flex; align-items: center; gap: var(--space-4); flex-wrap: wrap; }
.admin-who__text { flex: 1 1 240px; min-width: 0; }
.admin-who__text .h2 { overflow-wrap: anywhere; }
.setrow .control.admin-limit { width: 120px; margin-top: 0; flex-shrink: 0; }
.setrow select.control { width: auto; min-width: 150px; margin-top: 0; flex-shrink: 0; }
.setrow__controls { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; justify-content: flex-end; }

.admin-matrix td, .admin-matrix th { text-align: center; }
.admin-matrix td:first-child, .admin-matrix th:first-child { text-align: left; }
.admin-matrix .switch { display: inline-flex; position: relative; } /* keeps the hidden input inside the scrolling table */
.admin-matrix__desc { display: block; font-size: 13px; font-weight: 400; color: var(--ink-muted); }
.admin-na { color: var(--ink-faint); }

.admin-log { list-style: none; margin: 0; padding: 0; }
.admin-log li { display: flex; justify-content: space-between; gap: var(--space-4); padding: var(--space-3) 0; border-bottom: 1px solid var(--border-hairline); font-size: 14px; }
.admin-log li:last-child { border-bottom: 0; }
.admin-log time { color: var(--ink-muted); white-space: nowrap; font-size: 13px; }
.admin-link { background: none; border: 0; padding: 0; font: inherit; font-weight: 600; color: var(--primary-ink); cursor: pointer; }
.admin-link:hover { text-decoration: underline; }
