/* The admins' screens in the avatar's dialog: organisations, licences, laptops */

/* the screens with more columns get more room than Users */
.auth-dialog.wide.admin-wide { width: min(940px, calc(100vw - 32px)); }

/* a title with its button on the right, as "Issue a licence" */
.admin-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.admin-head .title { margin: 0; }
.auth-form .title:focus { outline: none; }
.auth-form .title:focus-visible { outline: 2px solid var(--lime); outline-offset: 3px; border-radius: 4px; }
.admin-viewing { padding: 10px 12px; border-radius: var(--radius); background: var(--tile); }

/* the tables as Users' */
.admin-table { overflow-x: auto; }
.admin-table .table { min-width: 760px; }
.admin-table td { padding: 7px 4px; }
.admin-table td small { display: block; margin-top: 2px; font-size: 11px; font-weight: 500; color: var(--ink-3); }
.admin-laptops .table { min-width: 720px; }
.admin-table td.admin-last-user { text-align: left; font-size: 12px; }
/* a licence's key, 5 groups of 5, kept on one line; its apps beside it */
.admin-code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; letter-spacing: 0.02em; white-space: nowrap; }
.title .admin-code { font-size: 0.72em; font-style: normal; font-weight: 700; letter-spacing: 0.04em; }
.admin-apps { font-size: 12px; font-weight: 500; color: var(--ink-3); }
.admin-table td.admin-dates { font-size: 12px; text-align: left; }
.admin-tools-off { white-space: normal; }
.admin-status { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; background: var(--tile); color: var(--ink-2); }
.admin-status-active { background: color-mix(in srgb, var(--lime) 30%, var(--tile)); color: var(--ink); }
.admin-status-revoked { color: var(--red); }
.admin-laptops td.team b, .admin-last-user { overflow-wrap: anywhere; }
.admin-seen, .admin-registered { font-size: 12px; }

/* Organisations: Add an organisation */
.auth-add.admin-org-add { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, 1fr) auto; }

/* Issue a licence and Extend: the fields in a row, the note and the tools below */
.admin-lic-form { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) minmax(0, 1fr) 90px; align-items: end; gap: 8px 10px; padding-top: 12px; border-top: 1px solid var(--line); }
.admin-lic-form h3 { grid-column: 1 / -1; margin: 0; font-size: 13px; }
.admin-lic-form .searchbox { height: 36px; padding: 8px 10px; font-size: 13px; }
.admin-lic-form select.searchbox { width: 100%; max-width: none; }
.admin-lic-form[data-auth-form="extend"] { grid-template-columns: 170px 90px minmax(0, 1fr); }
.admin-wide-field, .admin-tools, .admin-form-acts { grid-column: 1 / -1; }
.admin-form-acts { display: flex; justify-content: flex-end; gap: 8px; }

/* PSstudio's tools: one switch each, by group */
.admin-tools { display: grid; gap: 10px; margin: 0; padding: 10px 12px 12px; border: 1px solid var(--line); border-radius: var(--radius); }
.admin-tools[hidden] { display: none; }
.admin-tools legend { padding: 0 4px; font-size: 12px; font-weight: 600; color: var(--ink-2); }
.admin-tools-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 12px; }
.admin-tools-head .muted { margin-right: auto; }
.admin-tools-head .pill { padding: 5px 10px; font-size: 12px; }
.admin-tool-group h4 { margin: 0 0 4px; font-size: 11px; font-weight: 700; color: var(--ink-3); }
.admin-tool-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 2px 10px; }
.admin-tool { position: relative; display: flex; align-items: center; gap: 4px; min-width: 0; }
.auth-form .admin-tool label { display: flex; align-items: center; gap: 6px; min-width: 0; padding: 3px 0; font-size: 12px; font-weight: 500; color: var(--ink); cursor: pointer; }
.admin-tool input { flex: none; width: 15px; height: 15px; margin: 0; accent-color: var(--lime); }
.admin-tool input:not(:checked) + span { color: var(--ink-3); text-decoration: line-through; }
/* what the tool does: on hover and on the switch's keyboard focus; on a phone, its i opens it */
.admin-tool-tip { position: absolute; top: calc(100% + 2px); left: 0; z-index: 3; display: none; width: max-content;
  max-width: min(280px, calc(100vw - 72px)); padding: 7px 9px; border-radius: 8px; background: var(--ink); color: var(--on-ink);
  font-size: 12px; font-weight: 500; line-height: 1.4; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.22); pointer-events: none; }
.admin-tool:has(input:focus-visible) .admin-tool-tip, .admin-tool.open .admin-tool-tip { display: block; }
@media (hover: hover) {
  .admin-tool:hover .admin-tool-tip { display: block; }
}
.admin-tool-i { position: relative; display: none; flex: none; align-items: center; justify-content: center; width: 18px; height: 18px; padding: 0;
  border: 1px solid var(--line); border-radius: 50%; background: transparent; color: var(--ink-2);
  font: italic 700 11px/1 Georgia, "Times New Roman", serif; cursor: pointer; }
.admin-tool-i:focus-visible { outline: 2px solid var(--lime); outline-offset: 2px; }
.admin-tool.open .admin-tool-i { background: var(--ink); border-color: var(--ink); color: var(--on-ink); }
@media (max-width: 560px), (hover: none) {
  .admin-tool-i { display: inline-flex; }
  /* a bigger place to tap, the same size on the screen */
  .admin-tool-i::after { content: ""; position: absolute; inset: -10px -8px; }
}
/* on a phone the i takes some of each name's room: the box and the columns give a little back */
@media (max-width: 560px) {
  .admin-tools { padding: 8px 8px 10px; }
  .admin-tool { gap: 3px; }
  .admin-tool-i { width: 16px; height: 16px; font-size: 10px; }
  .auth-form .admin-tool label { gap: 5px; }
}

@media screen and (max-width: 560px) {
  .auth-add.admin-org-add { grid-template-columns: minmax(0, 1fr); }
  .admin-lic-form, .admin-lic-form[data-auth-form="extend"] { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .admin-lic-form[data-auth-form="issue"] > label:first-of-type, .admin-lic-form[data-auth-form="extend"] > label:nth-of-type(3) { grid-column: 1 / -1; }
  .admin-tool-list { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 6px; }

  /* the other tables: one card per row, the first cell on its own line and the buttons under the rest */
  .admin-table .table, .admin-table tbody { display: block; min-width: 0; }
  .admin-table thead { display: none; }
  .admin-table tr { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; padding: 10px 0; border-top: 1px solid var(--line); }
  .admin-table td { padding: 0; border: 0; text-align: left; font-size: 12px; }
  .admin-table td.team:first-child, .admin-table td.admin-dates, .admin-table .auth-row-acts { flex: 1 1 100%; }
  .admin-table td[colspan] { flex: 1 1 100%; }
  .admin-table td.team:first-child { font-size: 13px; }
  .admin-orgs td:nth-child(2)::before { content: "Users: "; }
  .admin-orgs td:nth-child(3)::before { content: "Licences: "; }
  .admin-orgs td:nth-child(4)::before { content: "Laptops: "; }
  .admin-orgs td:nth-child(5)::before { content: "Created "; }
  .admin-licences td:nth-child(3)::after { content: " laptops"; }
  .admin-laptops td.admin-last-user::before { content: "Last account: "; }
  .admin-laptops td.admin-registered::before { content: "Since "; }
  .admin-laptops td.admin-seen::before { content: "Last check-in "; }
  .admin-table td[colspan]::before, .admin-table td[colspan]::after { content: none; }
  .admin-table td:empty { display: none; }
}

/* the Developer page (js/developer.js): developer accounts only. One card per part, the state beside each title */
.dev-page > .muted:first-of-type { margin-top: -4px; }
.dev-card { margin: 0 0 12px; padding: 12px 14px 10px; border-radius: var(--radius); background: var(--card); box-shadow: inset 0 0 0 1px var(--line); }
.dev-card h3 { display: flex; align-items: center; gap: 10px; margin: 0 0 4px; font-size: 15px; }
.dev-card > p { margin: 0 0 8px; }
/* on the card's white, the buttons and the menu take the grey the dialog's own buttons sit on */
.dev-card .pill:not(.primary), .dev-card .searchbox { background: var(--tile); }
.dev-card .pill:not(.primary):hover { background: color-mix(in srgb, var(--tile) 88%, var(--ink)); }
.dev-card .table td.dev-link { text-align: left; }
.dev-state { padding: 2px 10px; border-radius: 999px; background: var(--tile); color: var(--ink); font-size: 12px; font-weight: 800; letter-spacing: 0.02em; white-space: nowrap; }
.dev-state.is-on { background: color-mix(in srgb, var(--lime) 55%, var(--card)); }
.dev-state.is-off { background: color-mix(in srgb, var(--red) 18%, var(--card)); color: var(--red); }
.dev-buttons { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 2px; }
.dev-row { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; }
.dev-row label { display: grid; gap: 4px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.dev-row select { min-width: 160px; }
.dev-link code { font-size: 12px; overflow-wrap: anywhere; }
.dev-danger { color: var(--red); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--red) 45%, transparent); }
.dev-badge { margin-left: 4px; padding: 1px 7px; border-radius: 999px; background: var(--ink); color: var(--on-ink); font-size: 10.5px; font-weight: 700; vertical-align: 1px; }
.dev-accounts { max-height: 340px; overflow: auto; }
.dev-log { list-style: none; margin: 0; padding: 0; max-height: 220px; overflow: auto; }
.dev-log li { padding: 5px 0; border-top: 1px solid var(--line); font-size: 13px; line-height: 1.4; }
.dev-log li:first-child { border-top: 0; }
.dev-when { display: inline-block; min-width: 108px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
@media (max-width: 560px) {
  .dev-when { display: block; min-width: 0; }
  .dev-accounts td.admin-org { display: none; }
}
.dev-card .auth-temp code { font-size: 13px; overflow-wrap: anywhere; }

/* a licence's switch (One laptop at a time per account), and a club admin's Activate a licence */
.admin-lic-form .admin-check { display: flex; align-items: center; gap: 8px; align-self: end; padding-bottom: 9px; font-weight: 600; }
.admin-lic-form .admin-check input { width: 16px; height: 16px; accent-color: var(--ink); }
.admin-redeem { display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; align-items: end; margin: 0 0 12px; padding: 12px 14px; border-radius: var(--radius); background: var(--card); box-shadow: inset 0 0 0 1px var(--line); }
.admin-redeem h3, .admin-redeem p { grid-column: 1 / -1; margin: 0; }
.admin-redeem label { display: grid; gap: 4px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.admin-redeem input { letter-spacing: 0.04em; text-transform: uppercase; background: var(--tile); }
/* a seat kept for offline work (Work offline on this laptop): its line under the laptop's name */
.admin-laptops .admin-kept { display: block; margin-top: 2px; font-size: 12px; font-weight: 600; color: var(--ink-2); }
