/* Admin console: the app's own look, with a few pieces of its own. */
.admin-tag { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 999px; font-size: 11.5px; font-weight: 700;
  letter-spacing: .02em; color: var(--carbon-ink); background: var(--carbon); margin-left: 2px; }
.auth.solo { grid-template-columns: minmax(0, 1fr); }
.auth.solo .auth-top .brand { display: inline-flex; align-items: center; gap: 10px; }
.auth.solo .auth-top .brand b { font-size: 18px; font-weight: 750; }
.code-input { font-family: var(--text); font-feature-settings: "tnum"; font-size: 22px !important; letter-spacing: .3em; }
.setup-steps { margin: 0; padding-left: 20px; display: grid; gap: 12px; color: var(--ink); line-height: 1.5; }
.setup-steps a { color: var(--pen); }
.totp-key { display: flex; align-items: center; gap: 10px; margin-top: 8px; padding: 10px 12px; border-radius: 12px; background: var(--paper-2); border: 1px solid var(--rule); }
.totp-key code { flex: 1; font-size: 16px; font-weight: 650; letter-spacing: .06em; word-break: break-all; }

.admin-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin: 18px 0; align-items: start; }
.admin-cols .sheet + .sheet { margin-top: 0; }
.page > .sheet + .admin-cols, .admin-cols + .sheet { margin-top: 18px; }
@media (max-width: 1100px) { .admin-cols { grid-template-columns: minmax(0, 1fr); } }

.kv { display: grid; grid-template-columns: minmax(120px, auto) minmax(0, 1fr); gap: 10px 18px; margin: 0; }
.kv dt { color: var(--pencil); font-size: 13.5px; }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.kv a { color: var(--pen); margin-left: 6px; }

.chip { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 999px; font-size: 12.5px; font-weight: 650; white-space: nowrap;
  background: var(--paper-2); color: var(--ink); box-shadow: inset 0 0 0 1px var(--rule); }
.chip.st-paying, .chip.st-contract { background: var(--ledger-wash); color: var(--ledger); box-shadow: none; }
.chip.st-trial { background: var(--pen-wash); color: var(--pen); box-shadow: none; }
.chip.st-trial_ended, .chip.st-canceled { color: var(--pencil); }
.chip.st-past_due, .chip.st-paused { background: var(--stamp-wash); color: var(--stamp); box-shadow: none; }
.bad-text { color: var(--stamp); }

.attention { list-style: none; margin: 0; padding: 6px 0; }
.attention li a { display: grid; gap: 2px; padding: 10px 20px 10px 26px; color: var(--ink); text-decoration: none; position: relative; }
.attention li a::before { content: ""; position: absolute; left: 12px; top: 16px; width: 7px; height: 7px; border-radius: 50%; background: var(--pencil); }
.attention li.lv1 a::before { background: var(--danger); }
.attention li.lv2 a::before { background: var(--warning); }
.attention li a:hover { background: var(--paper-2); }
.attention li a span { color: var(--pencil); font-size: 13.5px; }

.admin-filter { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 16px; }
.admin-filter .input { max-width: 320px; min-height: 42px; }
a.who.row-link { color: inherit; text-decoration: none; }
a.who.row-link:hover .cell-title { color: var(--pen); text-decoration: underline; }

.admin-form-row { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end; }
.admin-form-row .field { flex: 1 1 160px; min-width: 0; }
.admin-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; align-items: start; }
.admin-actions { white-space: nowrap; }
.admin-actions .btn + .btn { margin-left: 6px; }
tr.off td { opacity: .62; }
td.clip { max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.admin-log { list-style: none; margin: 0; padding: 8px 20px 14px; display: grid; gap: 12px; }
.admin-log li { display: grid; gap: 2px; }
.cell-sub.code { font-size: 12.5px; overflow-wrap: anywhere; }

.show-phone { display: none; }
@media (max-width: 760px) {
  .show-phone { display: block; }
  .admin-actions { white-space: normal; }
  .admin-actions .btn { margin: 3px 0 3px 6px; }
  .kv { grid-template-columns: minmax(0, 1fr); gap: 2px 0; }
  .kv dd { margin-bottom: 10px; }
  .admin-filter .input { max-width: none; }
  /* People: one card per person, actions underneath, nothing hidden off to the side */
  table.admin-people thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  table.admin-people, table.admin-people tbody, table.admin-people tr, table.admin-people td { display: block; width: 100%; }
  table.admin-people tr { padding: 10px 4px; border-bottom: 1px solid var(--rule); }
  table.admin-people td { border: 0 !important; padding: 4px 12px !important; text-align: left !important; }
  table.admin-people td.hide-phone { display: none; }
  table.admin-people td.admin-actions .btn { margin: 4px 6px 0 0; }
}
.admin-shell .table-wrap { position: relative; } /* keeps screen-reader-only labels inside the scroll box */

/* --- search, the role line, the phone's More menu ----------------------------------------------- */
.admin-search { position: relative; margin: 0 4px 14px; }
.admin-search svg { position: absolute; left: 12px; top: 50%; width: 16px; height: 16px; transform: translateY(-50%); color: var(--pencil); pointer-events: none; }
.admin-search .input { min-height: 40px; padding-left: 36px; border-radius: 12px; }
.admin-role { font-size: 12px; color: var(--pencil); }
.more-btn { display: none; }
.more-menu { display: none; }
.read-only-note { margin: 0 0 14px; }
.danger-rows { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 22px; }
.danger-rows > div { display: grid; gap: 6px; align-content: start; justify-items: start; }
.danger-rows p { margin: 0 0 6px; color: var(--pencil); font-size: 14px; }
.search-list { list-style: none; margin: 0; padding: 6px 0; }
.search-list a { display: flex; gap: 12px; align-items: center; padding: 10px 20px; color: var(--ink); text-decoration: none; }
.search-list a:hover { background: var(--paper-2); }
.search-list span { display: grid; }
.search-list small { color: var(--pencil); font-size: 13px; }
.events li b { font-weight: 600; overflow-wrap: anywhere; }
.events li.ev-error b, .events li.ev-critical b { color: var(--stamp); }
.events pre { margin: 6px 0 0; padding: 10px; max-height: 260px; overflow: auto; border-radius: 10px; background: var(--paper-2); font-size: 12px; white-space: pre-wrap; }
.day-bars { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; align-items: end; gap: 4px; height: 150px; }
.day-bars span { display: flex; align-items: flex-end; height: 100%; }
.day-bars i { display: block; width: 100%; height: max(var(--h), 2px); border-radius: 5px 5px 2px 2px; background: linear-gradient(180deg, #19b37f, #006644); }
.day-bars-axis { display: flex; justify-content: space-between; margin: 6px 0 10px; }
td.code, b.code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; overflow-wrap: anywhere; }

@media (max-width: 760px) {
  .admin-shell .rail .admin-search, .admin-shell .navlink.extra { display: none; }
  .admin-shell .more-btn { display: inline-flex; }
  .admin-shell .more-btn svg { transform: rotate(-90deg); }
  .more-menu { display: grid; position: fixed; z-index: 31; left: 12px; right: 12px; bottom: calc(86px + env(safe-area-inset-bottom)); gap: 2px; padding: 12px;
    border-radius: 22px; background: var(--paper); box-shadow: 0 18px 40px -12px rgba(0, 0, 0, .45), 0 0 0 1px var(--rule); }
  .more-menu .admin-search { margin: 0 0 6px; }
  .more-menu a { display: flex; align-items: center; gap: 12px; min-height: 46px; padding: 0 12px; border-radius: 12px; color: var(--ink); text-decoration: none; font-weight: 600; }
  .more-menu a svg { width: 19px; height: 19px; color: var(--pencil); }
  .more-menu a[aria-current="page"] { background: var(--ledger-wash); color: var(--ledger); }
  .more-menu .btn { justify-content: flex-start; margin-top: 4px; }
  .day-bars { height: 110px; gap: 2px; }
  .danger-rows { grid-template-columns: minmax(0, 1fr); }
}
.danger-zone .sheet-body.danger-rows { display: grid; align-items: start; }
