/* Staff dashboard (admin.html) only; the site's colours and type come from site.css. */

.admin-top { padding-top: 104px; padding-bottom: 64px; }
.admin-top h2 { margin: 6px 0 4px; }
.admin-bar { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; justify-content: space-between; margin: 8px 0 18px; color: var(--muted); font-size: 15px; }
.admin-bar .who b { color: var(--text); }
.admin-bar button { font: inherit; }

.tabs { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid var(--line-hi); margin-bottom: 22px; }
.tabs button {
  font: 600 13px "Chakra Petch", sans-serif; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--muted); background: transparent; border: 0; padding: 0 14px; min-height: 44px; cursor: pointer;
}
.tabs button:hover { color: var(--text); }
.tabs button[aria-selected="true"] { color: var(--text); box-shadow: inset 0 -2px 0 var(--red); }
.tabs button .badge { margin-left: 6px; }
.tab[hidden] { display: none; }

.badge {
  display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 10px; font-size: 12px; line-height: 20px;
  text-align: center; background: var(--red-deep); color: #fff; letter-spacing: 0;
}
.badge.ok { background: #1f6b45; }
.badge.mute { background: var(--line-hi); }

.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(220px, 100%), 1fr)); gap: 12px; }
.tile { padding: 14px 16px; background: linear-gradient(180deg, var(--panel), var(--bg-2)); border: 1px solid var(--line-hi); min-width: 0; }
.tile .label { display: block; color: var(--muted); font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; }
.tile .value { display: block; font: 600 28px/1.2 "Chakra Petch", sans-serif; color: var(--text); margin: 4px 0 2px; }
.tile .sub { display: block; color: var(--muted); font-size: 14px; overflow-wrap: anywhere; }
.tile.warn { border-color: var(--red); }
.tile a { overflow-wrap: anywhere; }

.admin-section { margin-top: 30px; }
.admin-section h3 { margin: 0 0 6px; font-size: 18px; }
.admin-section .hint { margin: 0 0 10px; }
.admin-filters { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; margin: 10px 0 6px; font-size: 14px; color: var(--muted); }
.admin-filters input, .admin-filters select {
  min-height: 40px; padding: 6px 10px; font: inherit; color: var(--text); background: var(--panel); border: 1px solid var(--line-hi); border-radius: 0;
}

.btn.small { padding: 8px 14px; font-size: 13px; min-height: 40px; }
.btn.small.ghost { padding: 8px 14px; }

table.admin { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: 14px; }
table.admin th { text-align: left; color: var(--muted); font-weight: 600; padding: 8px; border-bottom: 1px solid var(--line-hi); }
table.admin td { padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; overflow-wrap: anywhere; }
table.admin tr.picked td { background: rgba(224, 38, 47, 0.08); }
table.admin tr.done td { color: var(--muted); }
table.admin .why { color: var(--muted); }
table.admin .steps-text { color: #cfc6c0; white-space: pre-line; }
table.admin .actions { white-space: nowrap; }
table.admin .actions .btn { margin: 2px 4px 2px 0; }
table.admin input.note {
  width: 100%; min-height: 40px; margin: 6px 0; padding: 6px 10px; font: inherit; color: var(--text);
  background: var(--bg); border: 1px solid var(--line-hi); border-radius: 0;
}
.state-works { color: #3ee08a; font-weight: 600; }
.state-broken { color: #ff6b6b; font-weight: 600; }
.state-open { color: var(--ember-hi); font-weight: 600; }
.pending { color: var(--ember-hi); font-size: 13px; }

.link-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr)); gap: 8px; }
.link-list a { display: flex; align-items: center; min-height: 44px; padding: 8px 14px; border: 1px solid var(--line-hi); background: var(--panel); }
.link-list a:hover { border-color: var(--ember); }
.link-list small { display: block; color: var(--muted); }

.run-lines { margin: 4px 0 0; padding-left: 18px; color: var(--muted); font-size: 13px; }

@media (max-width: 800px) {
  .admin-top { padding-top: 32px; }
  .tabs { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .tabs button { flex: none; }

  /* Rows become cards so nothing scrolls sideways on a phone. */
  table.admin thead { display: none; }
  table.admin, table.admin tbody, table.admin tr, table.admin td { display: block; width: 100%; }
  table.admin tr { padding: 10px 0; border-bottom: 1px solid var(--line-hi); }
  table.admin td { display: flex; gap: 12px; justify-content: space-between; padding: 4px 0; border: 0; text-align: right; }
  table.admin td::before { content: attr(data-label); color: var(--muted); font-size: 13px; text-align: left; flex: none; }
  table.admin td.first { display: block; text-align: left; }
  table.admin td.first::before { content: none; }
  table.admin td.block { display: block; text-align: left; }
  table.admin td.block::before { display: block; }
  table.admin .actions { white-space: normal; }
}
