/* Setup: account, device and the admin panels. */

.setup-options {
  border: 1px solid var(--border);
  border-radius: .9rem;
  padding: .9rem;
  margin-bottom: 1rem;
  background: #f8fafc;
}
.setup-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem;
  align-items: center;
  margin-top: .85rem;
}

.setup-account-panel { background: #fff; }
.setup-account-status {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: .15rem;
}
.setup-account-status .small-note { margin: 0; }
.account-pill-row { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; }
.account-admin-pill,
.account-user-pill,
.account-company-pill {
  display: inline-flex;
  align-items: center;
  margin-top: .3rem;
  padding: .15rem .55rem;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 700;
}
.account-admin-pill { background: var(--header); color: var(--text); text-transform: uppercase; letter-spacing: .04em; }
.account-user-pill { background: #2563eb; color: #fff; text-transform: uppercase; letter-spacing: .04em; }
/* Company names keep their own capitalisation. */
.account-company-pill { background: #f1f5f9; border: 1px solid var(--border); color: var(--text); font-weight: 800; }
.setup-sign-out {
  margin-top: .5rem;
  min-height: 40px;
  padding: 8px 14px;
  font-size: 0.9rem;
  background: #000;
}

.device-facts {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: .35rem 1rem;
  margin: .5rem 0 0;
  font-size: .92rem;
}
.device-facts dt { color: var(--label); font-weight: 700; }
.device-facts dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }

/* --- Admin panels ---------------------------------------------------------
   Everything else in Setup is about you or this device. These two change who
   can reach a company's data, for everybody, so they sit last and are painted
   in the header's dark slate: by the time you are in one you should know you
   have left the settings behind. Only the chrome goes dark; the controls and
   user rows inside stay light so they read as they do everywhere else. */
.setup-admin-panel {
  background: linear-gradient(135deg, #0f172a, #334155);
  border-color: #0f172a;
  color: #fff;
}
.setup-admin-panel > h3 { color: #fff; padding-bottom: .5rem; border-bottom: 2px solid var(--header); }
.setup-admin-panel h4 { color: #fff; }
.setup-admin-panel .small-note { color: #cbd5e1; }
.setup-admin-panel label { color: #e2e8f0; }

.admin-subsection { margin-top: 1rem; }
.admin-subsection h4 { display: flex; align-items: center; gap: .5rem; }
.admin-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.4rem;
  height: 1.4rem;
  padding: 0 .4rem;
  background: var(--header);
  color: var(--text);
  border-radius: 999px;
  font-size: .8rem;
  font-weight: 700;
}
.admin-domains-input { min-height: 4.5rem; padding: .5rem .6rem; }
.admin-subsection-actions { display: flex; align-items: center; gap: .6rem; margin-top: .5rem; flex-wrap: wrap; }
.admin-subsection-actions .small-note { margin: 0; }
/* The key an admin reads out down a phone: large and monospaced, because
   telling O from 0 is the whole difficulty in dictating it. */
.admin-key-row { display: flex; align-items: center; gap: .6rem; margin-top: .5rem; flex-wrap: wrap; }
.admin-key-input {
  width: auto;
  flex: 0 1 9rem;
  margin-top: 0;
  padding: .45rem .6rem;
  font-family: var(--mono);
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: .18em;
  text-align: center;
  /* letter-spacing trails the last character too; the indent re-centres it. */
  text-indent: .18em;
}
.admin-user-list { display: flex; flex-direction: column; gap: .4rem; margin-top: .4rem; }
.admin-user-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .5rem .65rem;
  border: 1px solid var(--border);
  border-radius: .6rem;
  background: #fff;
  color: var(--text);
}
.setup-admin-panel .admin-user-row { border-color: transparent; }
.admin-user-info { display: flex; flex-direction: column; gap: .1rem; min-width: 0; }
.admin-user-info strong { word-break: break-word; }
.admin-user-info .small-note,
.setup-admin-panel .admin-user-row .small-note { margin: 0; color: var(--muted); }
.admin-user-actions { display: flex; gap: .4rem; flex-shrink: 0; flex-wrap: wrap; }
/* The hide tick boxes get their own line under the email and buttons: their
   labels are long enough to push Delete off the edge on a tablet. */
.admin-user-hides {
  flex: 1 0 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .3rem .9rem;
  margin-top: .1rem;
  padding-top: .45rem;
  border-top: 1px solid var(--border);
}
.admin-user-hide,
.setup-admin-panel .admin-user-hide {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font-size: .85rem;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
  color: var(--text);
  white-space: nowrap;
  cursor: pointer;
}
.admin-user-hide-status:empty { display: none; }

@media (max-width: 520px) {
  .setup-action-row > * { flex: 1 1 100%; }
  .device-facts { grid-template-columns: 1fr; }
  .device-facts dd { margin-bottom: .35rem; }
}
