/* Admin view (js/admin.js) — the owner's account table. Plain table with
   row dividers, no boxes; colours from the css/base.css variables. */

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

.admin-muted { color: var(--text-muted); font-size: var(--fs-sm); }
.admin-error { color: var(--danger); font-size: var(--fs-sm); }

.admin-scroll { overflow-x: auto; }

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-sm);
}
/* Type, case and colour come from the shared eyebrow rule on th in
   css/base.css. */
.admin-table th {
  padding: var(--sp-2);
  border-bottom: 1px solid var(--border);
  text-align: left;
  white-space: nowrap;
}
.admin-table td {
  padding: var(--sp-3) var(--sp-2);
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
/* Dates stay on one line and the actions column takes only what its buttons
   need, so a row is one line tall (issue #16 F-43). */
.admin-table .admin-date { white-space: nowrap; }
.admin-table .admin-act { width: 1%; white-space: nowrap; }
.admin-user { font-weight: 600; }
.admin-disabled td { color: var(--text-muted); }
.admin-flag { color: var(--danger); font-weight: 600; }

.admin-actions { display: flex; flex-wrap: nowrap; gap: var(--sp-2); }
.admin-actions .btn { white-space: nowrap; }
.admin-actions .btn.armed {
  background: var(--danger);
  border-color: var(--danger);
  color: var(--on-accent);
}

/* The one-time temporary password: a plain section, set off by a rule. */
.admin-reveal {
  margin: 0 0 var(--sp-4);
  padding: 0 0 var(--sp-4);
  border-bottom: 1px solid var(--border);
}
.admin-reveal h3 { margin: 0 0 var(--sp-1); font-size: var(--fs-md); }
.admin-reveal p { margin: 0 0 var(--sp-3); }
.admin-reveal-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); }
.admin-temp-pw {
  padding: var(--sp-1) var(--sp-2);
  background: var(--surface-2);
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: var(--fs-md);
  user-select: all;
}

/* Layout fixes (issue #16 item 6): the inline "Set phone" field. The input
   is wide enough for a full number and Save/Cancel wrap with a gap instead
   of stacking flush against each other. */
.admin-phone { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); }
.admin-phone input { width: 18ch; flex: none; }

/* Narrow page column (issue #16 F-45): the nine-column table does not fit,
   so each account becomes a block with one labelled line per value instead
   of a table scrolling sideways with its actions out of sight. The header
   row stays for screen readers. */
@container main (max-width: 860px) {
  .admin-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }
  .admin-table, .admin-table tbody, .admin-table tr { display: block; }
  .admin-table tr {
    padding: var(--sp-3) 0;
    border-bottom: 1px solid var(--border);
  }
  .admin-table tr:last-child { border-bottom: 0; }
  .admin-table td {
    display: flex;
    align-items: baseline;
    gap: var(--sp-3);
    padding: var(--sp-0) 0;
    border-bottom: 0;
  }
  .admin-table td::before {
    content: attr(data-label);
    flex: 0 0 10ch;
    font-size: var(--fs-xs);
    font-weight: 600;
    letter-spacing: var(--label-tracking);
    text-transform: uppercase;
    color: var(--text-muted);
  }
  .admin-table td.admin-account { display: block; padding-bottom: var(--sp-1); }
  .admin-table td.admin-account::before,
  .admin-table td.admin-act::before { content: none; }
  .admin-table .admin-act { width: auto; padding-top: var(--sp-2); }
  .admin-table .admin-actions { flex-wrap: wrap; }
}
