/* Management surfaces. Design pass follows Unslop by Damir Sokolovsky,
   https://github.com/heydamir/unslop (CC BY 4.0). */
.admin-page { background: var(--bg); }
.admin-page .us-topbar { min-height: 64px; }
.admin-page .us-topbar > .us-small { color: var(--muted); }
.admin-layout { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: calc(100dvh - 64px); margin: 0; padding: 0; max-width: none; }
.admin-sidebar { display: flex; flex-direction: column; gap: 16px; min-width: 0; padding: 28px 16px 24px; border-right: 1px solid var(--line); background: var(--panel); }
.admin-nav-caption { padding: 0 12px; color: var(--muted); font-size: 12px; line-height: 20px; }
.us-tabs.admin-nav { display: flex; flex-direction: column; gap: 4px; margin: 0; padding: 0; border: 0; overflow: visible; }
.us-tabs.admin-nav button { display: flex; align-items: center; gap: 12px; position: relative; min-height: 40px; padding: 8px 12px; text-align: left; border: 0; border-radius: 8px; font-size: 13px; line-height: 20px; color: var(--muted); }
.us-tabs.admin-nav button:hover { background: var(--panel-2); color: var(--ink); }
.us-tabs.admin-nav button[aria-selected="true"] { color: var(--brand); background: var(--panel-2); font-weight: 600; box-shadow: inset 0 0 0 1px var(--line); }
.us-tabs.admin-nav button[aria-selected="true"]::before { content: ""; position: absolute; left: -16px; width: 3px; height: 20px; background: var(--brand); border-radius: 0 2px 2px 0; }
.admin-nav svg { width: 18px; height: 18px; flex: 0 0 18px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.admin-sidebar-note { margin-top: auto; border-top: 1px solid var(--line); padding: 20px 12px 0; font-size: 12px; line-height: 24px; color: var(--muted); }
.admin-workspace-link { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 24px; padding: 16px 12px 0; border-top: 1px solid var(--line); color: var(--ink); font-size: 13px; text-decoration: none; }
.admin-workspace-link:hover { color: var(--brand); }
.admin-content { min-width: 0; padding: 32px; }
.ta-panel { display: grid; align-content: start; gap: 24px; min-width: 0; width: 100%; max-width: 1600px; margin: 0 auto; }
.ta-panel > p { margin: -8px 0 0; max-width: 900px; line-height: 24px; }
.ta-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; min-width: 0; }
.ta-head h2, .mi-stack > h2 { margin: 0; font-size: 28px; line-height: 36px; font-weight: 500; flex: 1; }
.ta-panel .us-card { padding: 24px; box-shadow: none; border-radius: 12px; }
.ta-panel .us-card h3 { font-size: 16px; font-weight: 600; }
.ta-panel .us-table-wrap { width: 100%; min-width: 0; overflow-x: auto; overscroll-behavior-inline: contain; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.ta-panel .us-table { width: 100%; font-size: 13px; font-variant-numeric: tabular-nums; }
.ta-panel .us-table th, .ta-panel .us-table td { padding: 16px; text-align: left; border-bottom: 1px solid var(--line); }
.ta-panel .us-table th { background: var(--panel-2); font-size: 12px; font-weight: 500; white-space: nowrap; }
.ta-panel .us-table td { line-height: 24px; }
.ta-panel .us-table tr:last-child td { border-bottom: 0; }
.ta-panel .us-table tbody tr:hover { background: #fafbf9; }
.ta-panel .us-table tbody tr:focus-within { background: var(--panel-2); }
.ta-panel .us-table td:first-child { font-weight: 500; }
.ta-panel .us-table td:last-child { min-width: 160px; }
.ta-panel .us-table td > .ta-inline { white-space: nowrap; }
.ta-panel .us-table .us-btn.small { min-height: 32px; padding: 4px 8px; }
.ta-panel .us-table .us-btn:not(.primary):not(.danger) { border-color: transparent; background: transparent; }
.ta-panel .us-table .us-btn:not(.primary):hover { background: var(--panel-2); border-color: var(--line); }
.ta-panel .us-table .us-btn.danger { border-color: transparent; background: transparent; }
.ta-panel[data-view="tenants"] .us-table { min-width: 1000px; }
.ta-panel[data-view="staff"] .us-table { min-width: 960px; }
.ta-panel[data-view="audit"] .us-table { min-width: 880px; }
.ta-panel[data-view="keys"] .us-table { min-width: 800px; }
.ta-panel[data-view="faq"] .us-table { min-width: 760px; }
.pf-login-link { display: inline-block; max-width: 248px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); text-decoration: none; font-size: 12px; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.pf-login-link:hover { color: var(--brand); text-decoration: underline; }
.pf-entry { min-width: 32px; font-size: 18px !important; line-height: 20px; }
.ta-status { display: inline-flex; gap: 8px; align-items: center; font-size: 12px; white-space: nowrap; }
.ta-status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--muted); }
.ta-status.is-active::before { background: var(--ok); }
.ta-status.is-inactive { color: var(--muted); }
.ta-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--panel); }
.ta-stat { padding: 24px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.ta-stat:nth-child(3n) { border-right: 0; }
.ta-stat:nth-last-child(-n+3) { border-bottom: 0; }
.ta-stat b { display: block; margin-bottom: 8px; font-size: 32px; line-height: 40px; font-weight: 500; font-variant-numeric: tabular-nums; color: var(--ink); }
.ta-stat span { font-size: 13px; }
.ta-channel { display: grid; grid-template-columns: 152px minmax(0, 1fr); gap: 24px; align-items: start; }
.ta-channel img.ta-qr { width: 152px; height: 152px; padding: 8px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.ta-channel .ta-head h2 { font-size: 18px; line-height: 28px; }
.ta-channel > div { min-width: 0; }
.ta-channel .ta-url { margin: 16px 0; }
.ta-url { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; line-height: 24px; overflow-wrap: anywhere; background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 12px 16px; }
.ta-secret { font-family: ui-monospace, Menlo, Consolas, monospace; overflow-wrap: anywhere; background: #faf6e9; border: 1px solid #e7ddbd; padding: 12px 16px; border-radius: 8px; }
.ta-locale-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(232px, 1fr)); gap: 16px; }
.ta-inline { display: inline-flex; gap: 8px; align-items: center; }
.ta-swatch { width: 20px; height: 20px; border-radius: 4px; border: 1px solid var(--line); display: inline-block; vertical-align: middle; }
.ta-swatch.jade { background: #16634b; }
.ta-swatch.ocean { background: #1d5fd1; }
#ta-settings { display: grid; gap: 16px; }
#ta-settings h3 { margin: 16px 0 0; padding-top: 24px; border-top: 1px solid var(--line); }
#ta-settings .us-field { margin: 0; }
#ta-settings > .us-field { max-width: 640px; }
#ta-settings .us-row > input[type="time"] { width: 144px; }
#ta-settings input[type="file"] { width: 100%; max-width: 400px; font-size: 13px; }
#ta-settings button[type="submit"] { justify-self: start; min-width: 112px; margin-top: 8px; }
.admin-auth-label { margin-bottom: 24px; color: var(--muted); font-size: 12px; }
@media (min-width: 1760px) {
  .ta-stats { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .ta-stat, .ta-stat:nth-child(3n) { border-bottom: 0; border-right: 1px solid var(--line); }
  .ta-stat:last-child { border-right: 0; }
}
@media (max-width: 1040px) {
  .admin-layout { grid-template-columns: 208px minmax(0, 1fr); }
  .admin-sidebar { padding-inline: 12px; }
  .us-tabs.admin-nav button { gap: 8px; padding-inline: 8px; }
  .us-tabs.admin-nav button[aria-selected="true"]::before { left: -12px; }
  .admin-content { padding: 24px; }
  .ta-stats .ta-stat { padding: 20px; }
}
@media (max-width: 720px) {
  .admin-page .us-topbar { flex-wrap: wrap; gap: 8px 16px; padding: 16px; }
  .admin-page .us-topbar > .us-small { order: 3; width: 100%; }
  .admin-page .us-topbar .us-brand { min-width: 0; flex: 1; }
  .admin-page .us-topbar .us-brand > span:last-child { overflow-wrap: anywhere; }
  .admin-layout { display: block; min-height: auto; }
  .admin-sidebar { display: block; border-right: 0; border-bottom: 1px solid var(--line); padding: 8px 12px; }
  .admin-nav-caption, .admin-sidebar-note, .admin-workspace-link { display: none; }
  .us-tabs.admin-nav { flex-direction: row; overflow-x: auto; overscroll-behavior-inline: contain; padding: 4px; }
  .us-tabs.admin-nav button { flex: 0 0 auto; min-height: 40px; gap: 8px; padding: 8px 12px; }
  .us-tabs.admin-nav button[aria-selected="true"]::before { display: none; }
  .admin-content { padding: 24px 16px 40px; }
  .ta-panel { gap: 20px; }
  .ta-head h2, .mi-stack > h2 { font-size: 24px; line-height: 32px; }
  .ta-panel .us-card { padding: 20px; }
  .ta-panel .us-table { min-width: 640px; }
  .ta-panel .us-table th, .ta-panel .us-table td { padding: 12px; }
  .ta-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ta-stat:nth-child(3n) { border-right: 1px solid var(--line); }
  .ta-stat:nth-child(2n) { border-right: 0; }
  .ta-stat:nth-last-child(-n+3) { border-bottom: 1px solid var(--line); }
  .ta-stat:nth-last-child(-n+2) { border-bottom: 0; }
  .ta-channel { grid-template-columns: 1fr; gap: 20px; }
  .ta-channel img.ta-qr { width: 144px; height: 144px; }
  .ta-locale-grid { grid-template-columns: 1fr; }
  .ta-head { gap: 12px; }
}
