/* ===== The Admin tab: John's "B: Settings console" (Nov 10, 2026) =====
   A rail of grouped pages with the team's name on top, the open page marked
   with a blue edge; each page (.admin-sec) its group over its title, its
   main buttons on the title's right (.admin-sec-head), then bordered panels
   (.admin-box, and the Account page's cards' .account-panel inside
   .admin-cards) of label | value rows with dividers. On a phone the rail is
   one list above the page and every row puts its label over its value.
   The page's own tokens and font only. The rail's behaviour is adminUI.js's,
   shared with Platform, whose markup takes these classes for the same look
   (the rules kept to #admin-panel here are css/platform.css's there). */

#admin-panel { font-weight: 400; }
.admin-icons { position: absolute; width: 0; height: 0; overflow: hidden; }
.admin-ico {
  width: 16px;
  height: 16px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* --- The rail --- */
#admin-panel .admin-rail {
  width: 240px;
  gap: 0;
  padding: 18px 12px;
  overflow-y: auto;
}
.admin-rail-head { padding: 0 10px 14px; border-bottom: 1px solid var(--border); }
.admin-rail-head .section-nav-title { margin: 0 0 4px; padding: 0; }
.admin-rail-team { font-size: 13.5px; font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
.admin-rail-team:empty { display: none; }
.admin-rail-group { margin-top: 14px; }
/* A group none of whose pages this person may see goes with them. */
.admin-rail-group:not(:has(.section-nav-btn:not(.hidden))) { display: none; }
.admin-rail-group-title {
  margin: 0 0 6px;
  padding: 0 10px;
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
}
.admin-rail .section-nav-list { gap: 2px; }
.admin-rail .section-nav-btn {
  position: relative;
  gap: 10px;
  min-height: 32px;
  padding: 6px 10px;
  border-radius: var(--radius);
  font-size: 13px;
  line-height: 1.25;
}
.admin-rail .section-nav-btn.active { font-weight: 600; }
.admin-rail .section-nav-btn.active::before {
  content: "";
  position: absolute;
  left: -1px;
  top: 7px;
  bottom: 7px;
  width: 3px;
  border-radius: 0 2px 2px 0;
  background: var(--accent);
}
.admin-rail .section-nav-btn.active .admin-ico { color: var(--accent); }

/* On a phone only (below): the rail as one list. */
.admin-picker { display: none; }

/* --- A page --- */
#admin-panel .section-content { padding: 28px 40px 48px; }
.admin-sec { max-width: 860px; }
/* The two long lists keep their room. */
#admin-sec-prices, #admin-sec-spec-sheets { max-width: 1240px; }
.admin-sec-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
  padding-bottom: 16px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
}
.admin-sec-titles { min-width: 0; }
.admin-sec-group {
  margin: 0 0 6px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-dim);
}
.admin-sec-title { width: fit-content; max-width: 100%; margin: 0; font-size: 20px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.25; overflow-wrap: anywhere; }
/* It takes the keyboard when its page is picked: the ring hugs the words
   (as wide as they are), clear of the group's name over them. */
.admin-sec-title:focus-visible { outline-offset: 1px; border-radius: 3px; }
.admin-sec-title:focus:not(:focus-visible) { outline: none; }
.admin-sec-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.admin-sec-actions:empty { display: none; }
.admin-sec-actions button,
.admin-sec-actions .quote-import-btn { min-height: 32px; font-size: 13px; }
.admin-sec-hint { margin: -6px 2px 16px; font-size: 12.5px; line-height: 1.45; color: var(--text-dim); }
#admin-panel .hint { font-size: 12.5px; line-height: 1.45; color: var(--text-dim); }
#admin-panel .hint.error,
#admin-panel .prices-status.error { color: var(--danger-text); }
.admin-sec > .hint { margin: 12px 2px; }

/* --- Panels and their rows --- */
.admin-box,
.admin-cards .account-panel {
  min-width: 0;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.admin-box + .admin-box { margin-top: 16px; }
.admin-row {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  align-items: start;
  padding: 13px 16px;
  font-size: 13px;
}
.admin-row + .admin-row { border-top: 1px solid var(--border); }
.admin-row-label { padding-right: 16px; font-weight: 500; line-height: 1.45; }
.admin-row-value { min-width: 0; line-height: 1.45; }
.admin-row-value > * { margin: 0; }
.admin-row-value > * + * { margin-top: 6px; }
/* A toolbar of the page's own controls, in a panel. */
.admin-box > .admin-toolbar { margin: 0; padding: 12px 16px; }
.admin-box > .admin-toolbar + .admin-toolbar { border-top: 1px solid var(--border); }
.admin-toolbar input[type="search"] { flex: 1 1 240px; min-width: 0; max-width: 420px; }
.admin-toolbar input[type="search"],
.admin-toolbar select,
.letterhead-box input[type="text"] {
  min-height: 32px;
  padding: 6px 10px;
  font-size: 13px;
  font-family: inherit;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.admin-toolbar select { background: var(--panel-alt); }
.admin-toolbar .quote-import-btn { font-size: 13px; }
.admin-toolbar .required-kits-setting { font-size: 12px; color: var(--text-dim); }

/* The Account page's cards in a page (adminTeam.js): a card is a stack,
   its .account-panel the bordered panels, each fact and form a row. */
.admin-cards { max-width: none; }
.admin-cards .account-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 0;
  background: none;
  border: 0;
  border-radius: 0;
}
.admin-cards .account-card > * { margin: 0; }
.admin-cards .account-card > h3 { font-size: 14px; }
.admin-cards .account-card > .hint { margin: -6px 2px 0; font-size: 12px; }
.admin-cards .account-status:empty { display: none; }
.admin-cards .account-panel > * { margin: 0; padding: 12px 16px; }
.admin-cards .account-panel > * + * { border-top: 1px solid var(--border); }
/* A note under the facts sits under their values; one about a fact (the
   price's tax) under that fact's value. */
.admin-cards .account-panel > .account-facts + .hint { padding: 0 16px 13px 216px; border-top: 0; font-size: 12px; }
.admin-cards .account-facts > dd > .hint { margin: 2px 0 0; font-size: 12px; }
.admin-cards .account-facts { grid-template-columns: 200px minmax(0, 1fr); gap: 0; padding: 0; }
.admin-cards .account-facts > dt,
.admin-cards .account-facts > dd { padding: 13px 16px; line-height: 1.45; }
.admin-cards .account-facts > dt:not(:first-child),
.admin-cards .account-facts > dt:not(:first-child) + dd { border-top: 1px solid var(--border); }
/* A form: its label on the left, its controls and words in the values'
   column. */
.admin-cards .account-form {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  align-items: center;
  row-gap: 6px;
}
.admin-cards .account-form > * { grid-column: 2; margin: 0; }
.admin-cards .account-form > .account-label { grid-column: 1; grid-row: 1; padding-right: 16px; font-size: 13px; font-weight: 500; color: var(--text); }
.admin-cards .account-form .hint { font-size: 12px; }
.admin-cards .account-actions { margin: 0; }
/* Its status, on: the page's OK green. */
.admin-cards dd.status-on > span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 1px 9px 1px 7px;
  font-size: 12px;
  line-height: 18px;
  color: var(--ok-fg);
  background: var(--ok-bg);
  border: 1px solid var(--ok-border);
  border-radius: 10px;
}
.admin-cards dd.status-on > span::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--ok-stroke); }
/* People & invites: the seats over a list of people, edge to edge. */
.admin-cards .seat-meters { padding: 14px 16px; }
.admin-cards .account-panel > .people-scroll,
.admin-cards .account-panel > .support-log-box { padding: 0; }
.admin-cards .people-table { border: 0; border-radius: 0; }
.admin-cards .people-table th { padding: 10px 16px; background: none; }
.admin-cards .people-table td { padding: 12px 16px; }
.admin-cards .support-log-more { margin: 0; padding: 0 16px 12px; }
.admin-cards .account-subhead {
  margin: 8px 2px -8px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-dim);
}

/* Letterhead & estimate (letterheadAdmin.js): the preview, then its forms
   as rows of one panel, and the proposal terms in their own. */
#admin-panel .letterhead-admin { max-width: none; }
.letterhead-box > .letterhead-form {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  align-items: start;
  gap: 6px 0;
  margin: 0;
  padding: 13px 16px;
}
.letterhead-box > .letterhead-form + .letterhead-form { border-top: 1px solid var(--border); }
.letterhead-box > .letterhead-form > * { grid-column: 2; margin: 0; }
.letterhead-box > .letterhead-form > .account-label { grid-column: 1; grid-row: 1; padding: 7px 16px 0 0; font-size: 13px; font-weight: 500; color: var(--text); }
/* A label over two boxes or more (the letterhead's lines) shares their
   rows, so its second line doesn't push the first box's row taller. */
.letterhead-box > .letterhead-form:has(> input[type="text"] + input[type="text"]) > .account-label { grid-row: 1 / span 2; }
.letterhead-box > .letterhead-form .hint { font-size: 12px; }
.letterhead-box input[type="text"] { width: 100%; max-width: 420px; }

/* Manufacturers and Team symbols: their rows as one panel. */
#admin-panel .manufacturers-admin-list,
#admin-panel .team-symbols-list { max-width: none; }
.manufacturers-admin-list:has(> .manufacturer-row),
.team-symbols-list:has(> .team-symbol-row) {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
#admin-panel .manufacturer-row,
#admin-panel .team-symbol-row { margin: 0; padding: 10px 16px; background: none; border: 0; border-radius: 0; }
#admin-panel .manufacturer-row + .manufacturer-row,
#admin-panel .team-symbol-row + .team-symbol-row { border-top: 1px solid var(--border); }

/* --- A narrow computer window (to 900px): beside the rail, a 200px
   label leaves its value too little room (Team's type of business and its
   Save ran past the page), so each row puts its label over its value, as
   on a phone. --- */
@media (min-width: 701px) and (max-width: 900px) {
  .admin-row,
  .admin-cards .account-form,
  .letterhead-box > .letterhead-form { grid-template-columns: minmax(0, 1fr); }
  .admin-row-label { padding: 0 0 6px; }
  .admin-cards .account-form > *,
  .letterhead-box > .letterhead-form > * { grid-column: 1; }
  .admin-cards .account-form > .account-label,
  .letterhead-box > .letterhead-form > .account-label { padding: 0; }
  .admin-cards .account-facts { grid-template-columns: minmax(0, 1fr); }
  .admin-cards .account-facts > dt { padding: 12px 16px 0; font-size: 12px; color: var(--text-dim); }
  .admin-cards .account-facts > dd { padding: 2px 16px 12px; }
  .admin-cards .account-facts > dt:not(:first-child) + dd { border-top: 0; }
  .admin-cards .account-panel > .account-facts + .hint { padding: 0 16px 12px; }
}

/* --- Phone --- */
@media (max-width: 700px) {
  #admin-panel { flex-direction: column; overflow-y: auto; }
  #admin-panel .admin-rail { display: none; }
  #admin-panel .section-content { overflow-y: visible; padding: 14px 16px 28px; }
  .admin-picker { display: block; margin-bottom: 18px; }
  .admin-picker-label { margin: 0 0 6px; }
  .admin-picker-box { position: relative; }
  .admin-picker-box .admin-ico { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--accent); pointer-events: none; }
  .admin-picker select {
    width: 100%;
    height: 42px;
    padding: 0 12px 0 38px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    color: var(--text);
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
  }
  .admin-sec-group { display: none; }
  .admin-sec-title { font-size: 18px; }
  .admin-sec-head { padding-bottom: 14px; margin-bottom: 16px; }
  .admin-sec-hint { margin-top: -4px; }

  /* Rows: the label over the value, so a long value has the width. */
  .admin-row,
  .admin-cards .account-form,
  .letterhead-box > .letterhead-form { grid-template-columns: minmax(0, 1fr); padding: 11px 14px; }
  .admin-row-label { padding: 0 0 6px; }
  .admin-cards .account-form > *,
  .letterhead-box > .letterhead-form > * { grid-column: 1; }
  .admin-cards .account-form > .account-label,
  .letterhead-box > .letterhead-form > .account-label { padding: 0; }
  .admin-cards .account-panel > * { padding: 11px 14px; }
  .admin-cards .account-facts { grid-template-columns: minmax(0, 1fr); padding: 0; }
  .admin-cards .account-facts > dt { padding: 11px 14px 0; font-size: 12px; color: var(--text-dim); }
  .admin-cards .account-facts > dd { padding: 2px 14px 11px; }
  .admin-cards .account-facts > dt:not(:first-child) + dd { border-top: 0; }
  .admin-cards .account-panel > .account-facts + .hint { padding: 0 14px 11px; }
  .admin-cards .seat-meters { padding: 11px 14px; }
  .admin-cards .people-list td { padding: 3px 14px; }
  .admin-cards .people-list td.people-wide { display: none; }
  .admin-cards .people-list tr { padding: 8px 0; }
  .admin-box > .admin-toolbar { padding: 11px 14px; }
  .admin-toolbar input[type="search"] { flex-basis: 100%; max-width: none; }
  #admin-panel .manufacturer-row,
  #admin-panel .team-symbol-row { padding: 10px 14px; }

  /* The price list and spec sheets: each row a block of lines, its prices
     named (priceList.js data-label), its button under them. */
  #admin-panel .items-admin-table thead { display: none; }
  #admin-panel .items-admin-table,
  #admin-panel .items-admin-table tbody,
  #admin-panel .items-admin-table tr { display: block; }
  #admin-panel .items-admin-table tr { padding: 8px 0; border-top: 1px solid var(--border); }
  #admin-panel .items-admin-table tr:first-child { border-top: 0; }
  #admin-panel .items-admin-table tr.items-editor-row { padding-top: 0; border-top: 0; }
  #admin-panel .items-admin-table td { display: block; max-width: none; min-width: 0; padding: 2px 0; border: 0; }
  #admin-panel .items-admin-table td.num { display: inline-block; margin-right: 14px; text-align: left; }
  #admin-panel .items-admin-table td:empty { display: none; }
  #admin-panel .items-admin-table td[data-label]::before { content: attr(data-label) " "; color: var(--text-dim); }
  #admin-panel .items-admin-table .items-num-cell { white-space: normal; overflow-wrap: anywhere; }
  #admin-panel .items-admin-table .spec-sheets-link-cell { overflow-wrap: anywhere; }
  /* The price editor's lines (an item's description, what it's drawn as)
     wrap at the page's edge (the row's cell doesn't wrap). */
  #admin-panel .items-editor-note { white-space: normal; overflow-wrap: anywhere; }
}
