.admin-panel { --admin-muted: #a4adbb; --admin-line: #303846; --admin-field: #191f29; --admin-blue: #9cc3ff; background: var(--bg); color: var(--text); min-height: calc(100dvh - 50px); padding: clamp(16px, 3vw, 32px); container-type: inline-size; }
.viewer:has(> .admin-panel) { background: var(--bg); }
.admin-panel [hidden] { display: none !important; }
.admin-panel :where(button, input, select) { font: inherit; }
.admin-panel button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 16px; border: 1px solid var(--admin-line); border-radius: 8px; background: var(--admin-field); color: var(--text); cursor: pointer; font-size: 14px; font-weight: 600; line-height: 1.3; transition: background 120ms; }
.admin-panel button:hover:not(:disabled) { background: #263140; }
.admin-panel button:active:not(:disabled) { background: #303f53; }
.admin-panel button:disabled { opacity: .45; cursor: default; }
.admin-panel :where(button, input, select, [tabindex]):focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.admin-panel button.admin-primary { background: #9cc3ff; color: #101b2d; border-color: #9cc3ff; }
.admin-panel button.admin-primary:hover:not(:disabled) { background: #bdd8ff; }
.admin-panel button.admin-link { color: var(--admin-blue); border-color: transparent; background: transparent; padding-inline: 8px; }
.admin-panel :where(input:not([type=checkbox]), select) { width: 100%; min-width: 0; min-height: 46px; border: 1px solid var(--admin-line); border-radius: 8px; padding: 10px 12px; background: var(--admin-field); color: var(--text); font-size: 16px; }
.admin-panel input::placeholder { color: #929eaf; }
.admin-panel input[aria-invalid=true] { border-color: #ee9393; }
.admin-panel h1 { font-size: clamp(24px, 3vw, 30px); line-height: 1.2; letter-spacing: -.035em; margin: 0; font-weight: 700; }
.admin-header { display: flex; flex-direction: column; align-items: flex-start; gap: 20px; padding-bottom: 28px; }
.admin-header p { color: var(--admin-muted); margin: 8px 0 0; font-size: 14px; line-height: 1.5; }
.admin-header > button { width: 100%; }
.admin-notice { margin-bottom: 20px; padding: 12px 16px; border-left: 3px solid #83cba5; background: #16271f; color: #bce6cd; font-size: 14px; line-height: 1.6; border-radius: 0 6px 6px 0; }
.admin-notice.is-error { border-color: #ee9393; background: #2f1d23; color: #ffd0d0; }
.admin-toolbar { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding-block: 20px; border-top: 1px solid var(--admin-line); }
.admin-toolbar label { min-width: 0; }
.admin-search { position: relative; grid-column: 1 / -1; }
.admin-search svg { position: absolute; top: 13px; left: 14px; color: var(--admin-muted); pointer-events: none; }
.admin-panel .admin-search input { padding-left: 44px; }
.admin-toolbar select { font-size: 14px; }
.admin-list-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; margin-bottom: 8px; }
.admin-result-count { color: var(--admin-muted); font-size: 13px; }
.admin-list { border: 1px solid var(--admin-line); border-radius: 10px; overflow: hidden; }
.admin-list[aria-busy=true] { opacity: .65; }
.admin-table { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 14px; }
.admin-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.admin-table tbody { display: block; }
.admin-table tr { display: grid; grid-template-columns: 1fr auto; gap: 12px 8px; padding: 18px 16px 8px; border-bottom: 1px solid var(--admin-line); }
.admin-table tr:last-child { border-bottom: 0; }
.admin-table td { min-width: 0; }
.admin-table td:first-child { grid-column: 1 / -1; }
.admin-table td:nth-child(3) { text-align: right; }
.admin-table .admin-date { display: none; }
.admin-person { display: flex; align-items: center; gap: 12px; min-width: 0; }
.admin-person > div { min-width: 0; }
.admin-avatar { display: grid; place-items: center; flex: 0 0 36px; height: 36px; border-radius: 50%; background: #252e3b; color: #c0cddd; font-size: 12px; font-weight: 700; }
.admin-avatar.is-admin { background: #243650; color: #a7ccff; }
.admin-email { display: block; font-weight: 600; overflow-wrap: anywhere; line-height: 1.5; }
.admin-self { display: block; font-size: 12px; color: var(--admin-muted); }
.admin-role { color: var(--admin-muted); font-size: 13px; }
.admin-role.is-admin { color: var(--admin-blue); }
.admin-status { display: inline-flex; gap: 6px; align-items: center; font-size: 12px; line-height: 1.4; max-width: 100%; }
.admin-status::before { content: ''; flex: 0 0 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-active { color: #a0d8b6; }
.status-pending { color: #e5c78b; }
.status-locked { color: #ffb3b3; }
.status-disabled { color: #a4adbb; }
.admin-row-action { grid-column: 1 / -1; }
.admin-panel .admin-row-action button { width: 100%; justify-content: space-between; background: transparent; border: 0; color: var(--admin-blue); padding: 8px 0; }
.admin-pagination { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 16px; color: var(--admin-muted); font-size: 13px; }
.admin-pagination nav { display: flex; gap: 8px; }
.admin-panel .admin-pagination button { width: 44px; padding: 10px; }
.admin-empty { padding: 44px 20px; text-align: center; color: var(--admin-muted); }
.admin-empty > svg { margin-bottom: 12px; color: #70839f; }
.admin-empty h2, .admin-empty h3 { font-size: 18px; margin: 0 0 8px; color: var(--text); }
.admin-empty p { font-size: 14px; line-height: 1.6; margin: 0 0 20px; }
.admin-empty button { margin-inline: auto; }
.admin-sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; padding: 0; border: 0; clip-path: inset(50%); white-space: nowrap; }
.admin-dialog { position: fixed; inset: 0 0 0 auto; margin: 0; padding: 0; width: min(100%, 540px); max-width: 100%; height: 100dvh; max-height: 100dvh; border: 0; border-left: 1px solid var(--admin-line); background: #121720; color: var(--text); box-shadow: -16px 0 60px #0004; overflow-y: auto; overscroll-behavior: contain; }
.admin-dialog::backdrop { background: #060a11b8; }
.admin-dialog-header { position: sticky; top: 0; z-index: 2; display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 24px; border-bottom: 1px solid var(--admin-line); background: #121720; }
.admin-dialog-header > div { min-width: 0; }
.admin-dialog-caption { color: var(--admin-muted); font-size: 12px; }
.admin-dialog h2 { margin: 7px 0 0; font-size: 22px; line-height: 1.4; letter-spacing: -.02em; overflow-wrap: anywhere; }
.admin-panel .admin-icon-button { flex: 0 0 44px; width: 44px; padding: 10px; background: transparent; }
.admin-tabs { display: flex; gap: 4px; padding: 8px 24px 0; border-bottom: 1px solid var(--admin-line); }
.admin-panel .admin-tabs button { flex: 1; min-width: 0; background: transparent; border: 0; border-radius: 0; color: var(--admin-muted); padding-inline: 8px; border-bottom: 2px solid transparent; }
.admin-panel .admin-tabs button[aria-selected=true] { color: var(--admin-blue); border-bottom-color: var(--admin-blue); }
.admin-form { display: grid; gap: 20px; padding: 24px; }
.admin-form label { display: grid; gap: 8px; color: #e0e6ef; font-size: 14px; font-weight: 500; }
.admin-description { color: var(--admin-muted); line-height: 1.6; font-size: 14px; margin: 0; }
.admin-hint { font-size: 13px; font-weight: 400; color: var(--admin-muted); line-height: 1.6; margin: -8px 0 0; }
label > .admin-hint { margin: 0; }
.admin-form h3 { font-size: 18px; margin: 0; }
.admin-password-field { display: flex; border: 1px solid var(--admin-line); border-radius: 8px; background: var(--admin-field); }
.admin-panel .admin-password-field input { border: 0; background: transparent; }
.admin-panel .admin-password-field button { flex: 0 0 auto; border: 0; background: transparent; color: var(--admin-blue); padding-inline: 12px; font-size: 12px; }
.admin-form-error { border: 1px solid #874f5b; background: #301e26; color: #ffd0d0; padding: 12px 14px; border-radius: 8px; line-height: 1.6; font-size: 14px; margin: 0; }
.admin-form-footer { display: flex; justify-content: flex-end; gap: 10px; padding-top: 24px; border-top: 1px solid var(--admin-line); margin-top: 8px; padding-bottom: env(safe-area-inset-bottom); }
.admin-form-footer button { min-width: 100px; }
.admin-app-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; color: var(--admin-muted); font-size: 13px; }
.admin-app-actions > div { display: flex; gap: 4px; }
.admin-panel .admin-app-actions button { font-size: 12px; }
.admin-apps { padding: 0; margin: 0; border: 1px solid var(--admin-line); border-radius: 10px; overflow: hidden; min-width: 0; }
.admin-form .admin-app-option { display: flex; align-items: center; gap: 12px; padding: 16px; border-bottom: 1px solid var(--admin-line); cursor: pointer; background: #151c27; }
.admin-app-option:last-child { border-bottom: 0; }
.admin-app-option:has(input:checked) { background: #1c2a3e; }
.admin-app-option input { flex: 0 0 18px; width: 18px; height: 18px; accent-color: #9cc3ff; }
.admin-app-option > span:last-child { min-width: 0; }
.admin-app-option strong { display: block; font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.admin-app-option small { display: block; color: var(--admin-muted); font-size: 12px; font-weight: 400; line-height: 1.5; margin-top: 4px; overflow-wrap: anywhere; }
.admin-app-symbol { display: grid; place-items: center; flex: 0 0 32px; height: 32px; color: #8ba0bb; }
.admin-app-symbol img { width: 32px; height: 32px; }
.admin-app-option.is-unavailable small { color: #e5c78b; }
.admin-apps:disabled .admin-app-option { cursor: default; }
.admin-discard { margin: 16px 24px; padding: 16px; border: 1px solid #766044; background: #2b241b; border-radius: 8px; }
.admin-discard p { margin: 0 0 12px; font-size: 14px; color: #f0d6ab; }
.admin-discard > div { display: flex; flex-wrap: wrap; gap: 8px; }
.admin-discard button { font-size: 12px; }
@container (min-width: 640px) {
  .admin-header { flex-direction: row; justify-content: space-between; align-items: center; }
  .admin-header > button { width: auto; flex-shrink: 0; }
  .admin-toolbar { grid-template-columns: minmax(160px, 1fr) 150px 170px; }
  .admin-search { grid-column: auto; }
  .admin-table thead { position: static; width: auto; height: auto; clip-path: none; }
  .admin-table tbody { display: table-row-group; }
  .admin-table tr { display: table-row; padding: 0; }
  .admin-table th { padding: 14px 16px; background: #181e28; color: var(--admin-muted); text-align: left; font-size: 12px; font-weight: 500; }
  .admin-table td { padding: 18px 16px; border-top: 1px solid var(--admin-line); vertical-align: middle; }
  .admin-table th:first-child { width: 38%; }
  .admin-table th:nth-child(2) { width: 22%; }
  .admin-table th:nth-child(3) { width: 22%; }
  .admin-table th:nth-child(4) { display: none; }
  .admin-table th:last-child { width: 18%; }
  .admin-table td:nth-child(3) { text-align: left; }
  .admin-panel .admin-row-action button { justify-content: flex-end; }
}
@container (min-width: 920px) {
  .admin-table th:first-child { width: 33%; }
  .admin-table th:nth-child(2) { width: 18%; }
  .admin-table th:nth-child(3) { width: 18%; }
  .admin-table th:nth-child(4) { display: table-cell; width: 15%; }
  .admin-table .admin-date { display: table-cell; color: var(--admin-muted); font-size: 12px; }
  .admin-table th:last-child { width: 16%; }
}
@media (max-width: 480px) {
  .admin-dialog-header { padding: 20px 16px; }
  .admin-tabs { padding-inline: 16px; }
  .admin-form { padding: 20px 16px; }
  .admin-form-footer { flex-direction: column-reverse; }
  .admin-form-footer button { width: 100%; }
  .admin-discard { margin-inline: 16px; }
}
@media (prefers-reduced-motion: reduce) { .admin-panel button { transition: none; } }
