/* Full-width staff workspace with independently scrolling content and left-hand controls. */
/* The public login page owns no dashboard navigation or workspace controls. */
.staff-login-page { background: radial-gradient(ellipse at 50% 20%, #291537 0, transparent 60%), var(--ink); }
.staff-login-shell { display: grid; place-items: center; padding: 32px 20px; }
.staff-login-card { width: min(100%, 520px); padding: clamp(24px, 5vw, 48px); border: 1px solid var(--line); border-radius: 16px; background: #191122; }
.staff-login-card h1 { font-size: clamp(32px, 6vw, 44px); }
.staff-login-card h1 span { color: var(--accent); }
.staff-login-card p { line-height: 1.6; overflow-wrap: anywhere; }
.staff-login-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
#staff-login-feedback { color: var(--muted); margin-bottom: 0; }
.staff-login-page .site-header { flex-wrap: wrap; }
/* The React mount is layout-transparent; the existing header and workspace remain grid items. */
#staff-app { display: contents; }
#staff-app > main { min-height: 0; min-width: 0; scroll-behavior: smooth; scroll-padding-block: 24px; }
.picker-host { display: block; }
.admin-page { background: radial-gradient(ellipse at 15% 0, #291537 0, transparent 48%), var(--ink); }
.admin-page .site-header { padding-inline: 32px; flex-wrap: wrap; }
#staff-app > .admin-shell { width: 100%; display: grid; grid-template-columns: 288px minmax(0, 1fr); overflow: hidden; }
.admin-workspace { min-width: 0; overflow: auto; padding: 36px clamp(24px, 3vw, 56px) 56px; scroll-padding: 32px; }
.admin-shell h2 { font-size: 28px; margin-bottom: 12px; }
.admin-hint, .admin-records > p { color: var(--muted); line-height: 1.6; }
.admin-controls { min-width: 0; overflow: auto; padding: 24px 16px; border-right: 1px solid var(--line); background: #15101e; display: flex; flex-direction: column; gap: 18px; }
.admin-controls-heading h2 { font-size: 25px; margin: 0; }
.admin-controls-heading .eyebrow { letter-spacing: 2px; margin-bottom: 8px; }
/* Compact rows and group headings keep the complete staff navigation easy to scan. */
.admin-nav { display: grid; gap: 8px; font-size: 13px; }
.admin-nav a { display: flex; min-height: 36px; line-height: 20px; padding: 7px 10px; gap: 10px; border: 1px solid transparent; border-radius: 8px; }
.admin-nav a[data-icon]::before { color: var(--accent); --icon-size: 18px; }
.admin-nav a:hover, .admin-tools a:hover { background: #d6b0fc0c; }
.admin-nav a[aria-current] { color: var(--text); background: linear-gradient(110deg, #62328066, #342044); border-color: #b58aca70; box-shadow: inset 3px 0 var(--accent); }
.admin-label { font-size: 10px; font-weight: 600; letter-spacing: 1.8px; color: var(--accent); margin-bottom: 12px; }
.admin-tools { padding-top: 24px; border-top: 1px solid var(--line); }
.admin-tools a { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 44px; font-size: 14px; border-radius: 6px; }
.admin-tools a span { color: var(--accent); }
.admin-tools .admin-hint { font-size: 12px; margin: 12px 0 0; }
/* Reuse the public wordmark and framed sigil at a readable dashboard title size. */
.admin-brand { display: flex; align-items: center; flex-wrap: wrap; gap: 16px 24px; min-width: 0; }
.admin-brand .wordmark { margin: 0; font-size: clamp(18px, 1.6vw, 24px); line-height: 1.25; text-transform: uppercase; }
.admin-brand .sigil { flex-shrink: 0; font-weight: 400; line-height: 1; }
.admin-home { white-space: nowrap; }
/* The profile popover stays anchored to the header, outside the scrolling workspace. */
.admin-session { position: relative; display: flex; align-items: center; gap: 20px; margin-left: auto; }
.admin-session .primary { margin: 0; width: auto; }
.admin-status, .admin-records { border: 1px solid var(--line); background: #191122; border-radius: 12px; padding: 24px; min-width: 0; }
/* Health stays compact; keyboard focus and hover reveal the same status details. */
.admin-connection { display: flex; align-items: center; gap: 16px; }
.admin-indicator { position: relative; display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12px; white-space: nowrap; }
.status-light { width: 8px; height: 8px; flex: 0 0 8px; border-radius: 50%; background: #f08080; box-shadow: 0 0 0 3px #f0808015; }
.admin-indicator[data-online=true] .status-light { background: #7bdba1; box-shadow: 0 0 0 3px #7bdba115; }
.indicator-detail { position: absolute; z-index: 5; top: calc(100% + 10px); right: 0; width: max-content; max-width: min(300px, calc(100vw - 32px)); padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: #21172d; color: var(--text); white-space: normal; line-height: 1.5; visibility: hidden; }
.admin-indicator:hover .indicator-detail, .admin-indicator:focus .indicator-detail { visibility: visible; }
.sticky-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.sticky-heading .admin-indicator { margin-left: auto; }
#sticky-feedback:empty, #sticky-editor-feedback:empty { display: none; }
/* Notifications sit outside the scrolling workspace and leave no empty page space. */
.admin-toast { position: fixed; z-index: 10; right: 24px; bottom: 24px; width: min(420px, calc(100vw - 32px)); display: flex; align-items: start; gap: 12px; padding: 16px; border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 10px; background: #21172d; box-shadow: 0 12px 36px #0008; }
#admin-feedback { flex: 1; min-width: 0; margin: 0; color: var(--text); font-size: 13px; line-height: 1.6; overflow-wrap: anywhere; }
#admin-toast-dismiss { font-size: 22px; }
.admin-panel { min-width: 0; }
.admin-shell fieldset { border: 1px solid var(--line); border-radius: 10px; padding: 24px; margin: 24px 0 0; min-width: 0; }
.admin-shell legend { padding: 0 8px; color: var(--accent); }
.admin-shell #settings-fields { border: 0; padding: 0; margin: 24px 0 0; }
.admin-visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0 !important; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.admin-settings-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; max-width: 960px; }
.admin-setting-group { min-width: 0; padding: 24px; border: 1px solid var(--line); border-radius: 12px; background: #191122; }
.admin-setting-group h3 { font-size: 24px; margin: 0 0 8px; }
.admin-shell label { display: block; margin: 20px 0 8px; font-size: 14px; line-height: 1.5; }
.admin-shell label span { color: var(--muted); }
/* All text controls share the dashboard theme, including multiline editors. */
.admin-shell input:not([type=checkbox]), .admin-shell select, .admin-shell textarea { display: block; width: 100%; max-width: 100%; min-height: 48px; border: 1px solid #897196; border-radius: 7px; padding: 10px 12px; background-color: var(--ink); color: var(--text); font: inherit; }
/* Native file controls retain their filename and keyboard behavior in the dashboard theme. */
.admin-shell input[type=file] { padding: 6px; }
.admin-shell input[type=file]::file-selector-button { min-height: 36px; margin-right: 12px; padding: 8px 14px; border: 1px solid #b58aca; border-radius: 5px; background: #623280; color: var(--text); font: inherit; cursor: pointer; }
.admin-shell input[type=file]:not(:disabled)::file-selector-button:hover { background: #8345a9; }
.admin-shell input[type=file]:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.admin-shell input[type=file]:disabled::file-selector-button { opacity: .5; cursor: not-allowed; }
/* Preserve row-based height and vertical resizing without breaking narrow layouts. */
.admin-shell textarea { min-height: 90px; padding: 12px; line-height: 1.6; resize: vertical; }
.admin-shell .admin-check { display: flex; align-items: center; gap: 12px; }
.admin-check input { width: 22px; height: 22px; accent-color: var(--accent); }
/* Theme both ordinary confirmation checkboxes and feature switches without losing native semantics. */
.admin-check input { appearance: none; flex: 0 0 auto; border: 1px solid #897196; border-radius: 5px; background: #100a17; display: grid; place-content: center; cursor: pointer; }
.admin-check input:checked { background: #8345a9; border-color: #d6a4f3; }
.admin-check input:checked::after { content: '\2713'; font-size: 16px; line-height: 1; color: white; }
.admin-switch input { width: 44px; height: 25px; border-radius: 20px; padding: 3px; display: block; position: relative; }
.admin-switch input::after, .admin-switch input:checked::after { content: ''; display: block; width: 17px; height: 17px; border-radius: 50%; background: #a995b4; transition: transform 150ms ease; }
.admin-switch input:checked::after { transform: translateX(18px); background: #fff2ff; }
.admin-shell :focus-visible { outline: 2px solid #d6a4f3; outline-offset: 3px; }
.admin-shell button:disabled, .admin-shell input:disabled { opacity: .55; cursor: not-allowed; }
/* Group disclosures keep the sidebar compact while retaining direct section links. */
.nav-group summary { cursor: pointer; color: #d4bddf; font-size: 11px; font-weight: 700; letter-spacing: 1.6px; text-transform: uppercase; min-height: 28px; line-height: 16px; padding: 6px 10px; }
.nav-group a { margin-bottom: 0; }
.configuration-status { padding: 0; list-style: none; }
.configuration-status li { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.configuration-status .configured { color: #a4d8b5; }
.configuration-status .missing { color: #dfb878; }
@media (prefers-reduced-motion: reduce) { .admin-switch input::after { transition: none; } }
.admin-hint { font-size: 13px; }
.admin-save { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-top: 24px; padding: 20px 0; border-top: 1px solid var(--line); }
.admin-save p { margin: 0; }
#update-commit, #update-feedback { overflow-wrap: anywhere; }
.admin-shell .feedback { margin: 20px 0; border-radius: 0 8px 8px 0; }
.admin-records li { padding: 16px 0; overflow-wrap: anywhere; line-height: 1.6; border-bottom: 1px solid var(--line); }
.admin-records ol, .admin-records ul { padding-left: 22px; }
.admin-records pre { white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; color: var(--muted); margin-bottom: 0; }
/* Full-width rows keep the workspace compact; editing opens in the native modal top layer. */
.sticky-list-heading { display: flex; align-items: baseline; gap: 12px 24px; flex-wrap: wrap; margin-top: 28px; }
.sticky-list-heading h3, .sticky-list-heading p { margin: 0; }
.sticky-list { display: grid; gap: 10px; list-style: none; padding: 0; margin: 16px 0 0; }
.sticky-list button { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 20px; width: 100%; text-align: left; padding: 18px 20px; background: var(--ink); color: var(--text); border: 1px solid var(--line); border-radius: 8px; cursor: pointer; overflow-wrap: anywhere; }
.sticky-list button:hover, .sticky-list button:focus-visible { border-color: var(--accent); background: #342044; }
.sticky-list button::after { content: ''; grid-column: 2; grid-row: 1 / 3; align-self: center; width: 8px; height: 8px; border: solid var(--accent); border-width: 1px 1px 0 0; transform: rotate(45deg); }
.sticky-list span { grid-column: 1; font-size: 12px; color: var(--muted); }
.sticky-actions { display: flex; gap: 12px; flex-wrap: wrap; margin: 20px 0 0; }
.sticky-actions .primary, .sticky-actions .secondary { width: auto; margin: 0; }
/* Only the body scrolls, keeping the title, feedback and save/cancel actions in view. */
#sticky-dialog, #template-dialog { width: min(1040px, calc(100% - 32px)); height: min(900px, 92dvh); max-height: 92dvh; padding: 0; overflow: hidden; border-radius: 12px; }
#sticky-dialog[open], #template-dialog[open], #sticky-form, #template-form { display: flex; flex-direction: column; }
.sticky-dialog-heading { display: flex; align-items: start; justify-content: space-between; gap: 16px; padding: 24px; border-bottom: 1px solid var(--line); }
.sticky-dialog-heading h2 { margin: 0; padding: 0; font-size: 28px; overflow-wrap: anywhere; }
.sticky-dialog-heading p { margin: 8px 0 0; }
#sticky-close, #template-dialog .icon-button { flex-shrink: 0; font-size: 26px; }
#sticky-form, #template-form { min-height: 0; flex: 1; }
.sticky-dialog-body { overflow-y: auto; min-height: 0; flex: 1; overscroll-behavior: contain; }
#sticky-fields { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 28px; border: 0; margin: 0; padding: 24px; }
.sticky-editor-inputs, .sticky-editor-preview { min-width: 0; }
.sticky-editor-preview { position: sticky; top: 24px; align-self: start; max-height: calc(min(900px, 92dvh) - 240px); overflow-y: auto; }
.sticky-editor-inputs > label:first-child { margin-top: 0; }
.sticky-editor-inputs h3 { margin-top: 28px; font-size: 22px; }
.sticky-editor-preview .sticky-preview { margin-top: 0; }
.sticky-dialog-footer { padding: 16px 24px; border-top: 1px solid var(--line); }
.sticky-dialog-footer .feedback { margin: 0 0 12px; max-height: 100px; overflow-y: auto; }
.sticky-dialog-actions { margin: 0; align-items: center; justify-content: flex-end; }
#sticky-delete { margin-right: auto; }
#sticky-discard, #template-discard { margin-bottom: 16px; }
#sticky-discard p, #template-discard p { margin: 0; }
#sticky-discard .sticky-actions, #template-discard .sticky-actions { margin-top: 8px; }
/* Colour inputs share the anchored popup without changing the editor's layout. */
.sticky-color-picker { max-width: 360px; }
#sticky-color-toggle { justify-content: flex-start; }
#sticky-color-toggle::after { margin-left: auto; }
#sticky-color-swatch { width: 32px; height: 28px; flex-shrink: 0; background: #bb83de; border: 1px solid #ffffff60; border-radius: 5px; }
#sticky-color-value, #sticky-color { font-family: ui-monospace, monospace; }
#sticky-color-panel { padding: 18px; }
#sticky-color-panel .admin-label { margin: 0 0 14px; }
.sticky-color-presets { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.sticky-color-presets button { width: 100%; min-width: 0; height: 32px; border: 2px solid #ffffff40; border-radius: 6px; cursor: pointer; }
.sticky-color-presets button[aria-pressed=true] { outline: 2px solid var(--text); outline-offset: 2px; }
#sticky-color-panel label { display: flex; justify-content: space-between; }
#sticky-color-panel output { font-variant-numeric: tabular-nums; color: var(--muted); }
#sticky-color-panel input[type=range] { appearance: none; padding: 0; height: 12px; min-height: 12px; margin: 14px 0 24px; border: 1px solid #897196; border-radius: 20px; cursor: pointer; }
#sticky-color-panel input[type=range]::-webkit-slider-thumb { appearance: none; width: 22px; height: 22px; border: 3px solid #f5ecfa; border-radius: 50%; background: #342044; box-shadow: 0 1px 5px #0008; }
#sticky-color-panel input[type=range]::-moz-range-thumb { width: 16px; height: 16px; border: 3px solid #f5ecfa; border-radius: 50%; background: #342044; box-shadow: 0 1px 5px #0008; }
#sticky-color-done { margin: 0; width: 100%; }
.sticky-preview { margin-top: 28px; padding: 18px; background: #242329; border-radius: 8px; overflow-wrap: anywhere; }
.sticky-preview p, .sticky-preview small, #sticky-preview-title { white-space: pre-wrap; }
#sticky-preview-embed { border-left: 4px solid; background: #18171c; padding: 16px; border-radius: 5px; }
#sticky-preview-image { max-width: 100%; max-height: 300px; object-fit: contain; }
#sticky-preview-thumbnail { float: right; width: 64px; height: 64px; object-fit: contain; }
.sticky-link-preview { display: inline-block; padding: 8px 14px; background: #45424c; border-radius: 5px; margin-top: 12px; }
@media (max-width: 700px) {
  #sticky-fields { grid-template-columns: minmax(0, 1fr); padding: 16px; }
  .sticky-editor-preview { position: static; max-height: none; overflow: visible; }
  .sticky-dialog-heading, .sticky-dialog-footer { padding: 16px; }
  .sticky-dialog-heading h2 { font-size: 23px; }
  .sticky-dialog-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .sticky-dialog-actions .primary, .sticky-dialog-actions .secondary { width: 100%; padding: 10px; }
  #sticky-delete { margin: 0; }
}
@media (max-width: 1200px) { .admin-settings-grid { grid-template-columns: 1fr; } }
@media (max-width: 900px) {
  #staff-app > .admin-shell { display: flex; flex-direction: column; overflow: auto; }
  .admin-controls { order: -1; overflow: visible; border-right: 0; border-bottom: 1px solid var(--line); padding: 16px 24px; gap: 12px; }
  .admin-controls-heading { display: none; }
  .admin-nav { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .admin-nav a { padding: 7px 8px; font-size: 12px; }
  .admin-nav a[data-icon]::before { --icon-size: 16px; }
  .admin-tools { padding-top: 16px; }
  .admin-tools a { display: inline-flex; margin-right: 20px; gap: 12px; }
  .admin-tools .admin-hint, .admin-tools .admin-label { display: none; }
  .admin-workspace { overflow: visible; padding: 28px 24px 40px; }
}
@media (max-width: 560px) {
  .admin-page .site-header { padding-inline: 16px; gap: 12px; }
  .admin-brand { gap: 10px; }
  .admin-brand .wordmark { font-size: 16px; }
  .admin-home { padding: 8px; font-size: 11px; }
  #admin-login { font-size: 11px; padding: 8px; }
  .admin-workspace, .admin-controls { padding-inline: 16px; }
  .admin-nav { grid-template-columns: 1fr; }
  .admin-nav a { font-size: 13px; }
  .admin-status, .admin-shell fieldset, .admin-records, .admin-setting-group { padding: 18px; }
  .admin-session { gap: 14px; }
  .admin-connection { flex-direction: column; align-items: flex-start; gap: 8px; }
  .admin-toast { right: 16px; bottom: 16px; }
  .admin-save { align-items: stretch; flex-direction: column; }
}
/* Touch and hybrid devices retain comfortable targets within the tighter group spacing. */
@media (any-pointer: coarse) {
  .admin-nav a, .nav-group summary { min-height: 44px; }
}
/* Embedded desks share the dashboard scroll container and keep their controls in scope. */
.admin-panel .ticket-shell, .admin-panel .vip-shell { width: 100%; max-width: none; margin: 0; padding: 0; }
.admin-panel.ticket-page { background: transparent; }
#access-fields { border: 0; padding: 0; min-width: 0; }
#access-roles { display: grid; gap: 18px; margin: 20px 0; }
.access-add-role { display: flex; align-items: end; gap: 16px; flex-wrap: wrap; }
.access-add-role > div { flex: 1 1 220px; min-width: 0; }
.access-role-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.access-permissions { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr)); gap: 0 16px; }
#access-roles fieldset { min-width: 0; padding: 16px; border: 1px solid var(--line); border-radius: 8px; }
#access-roles legend { overflow-wrap: anywhere; }
#access-roles small { color: var(--muted); }
#access-roles .admin-check { display: flex; gap: 10px; align-items: center; margin: 14px 0; }

/* The admission editor uses the dashboard palette while its preview preserves embed proportions. */
.verification-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; border-top: 1px solid var(--line); margin-top: 28px; padding-top: 28px; }
.verification-heading h3 { margin: 0; }
.verification-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; }
.verification-preview { align-self: start; margin-top: 24px; padding: 20px; background: #130d1d; border: 1px solid var(--line); border-radius: 10px; overflow-wrap: anywhere; }
.verification-preview .eyebrow { line-height: 1.8; }
.verification-embed { padding: 18px; border-left: 3px solid var(--accent); background: #21162e; border-radius: 5px; }
.verification-embed h4 { margin: 0 0 14px; font-size: 18px; }
.verification-embed p, .verification-embed small, .verification-embed h4 { white-space: pre-wrap; }
.verification-embed p { font-size: 14px; line-height: 1.7; }
.verification-embed small { display: block; color: var(--muted); }
#verification-preview-image { width: 100%; max-height: 280px; object-fit: contain; margin: 8px 0 16px; border-radius: 4px; }
#verification-preview-link { background: #623280; }
#verification-feedback { font-size: 13px; line-height: 1.7; color: var(--muted); }
@media (max-width: 1100px) { .verification-layout { grid-template-columns: 1fr; } }
/* Audit categories reuse the dashboard switches in a responsive, labelled grid. */
.audit-event-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 1.5rem; margin: 1.5rem 0; }
.audit-event-groups fieldset { min-width: 0; margin: 0; padding: 1rem; border: 1px solid var(--line, #493650); border-radius: .75rem; }
.audit-event-groups legend { padding: 0 .4rem; font-weight: 600; }
.audit-event-groups .admin-check { margin: .8rem 0; }
.audit-setup { margin: 1rem 0; }
.audit-status-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; }
/* Template lists and editor fields wrap within the dashboard on narrow screens. */
#templates fieldset { min-width: 0; margin: 24px 0; padding: 20px; border: 1px solid var(--line); border-radius: 8px; }
#templates label { display: block; margin: 16px 0 8px; }
#templates input:not([type="checkbox"]), #templates textarea { width: 100%; }
#templates .admin-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 18px; }
/* Template editing shares the sticky dialog chrome with a single-column message form. */
#template-dialog { width: min(760px, calc(100% - 32px)); }
#templates #template-fields { margin: 0; border: 0; padding: 24px; }
#template-fields > label:first-of-type { margin-top: 0; }
.template-list { list-style: none; padding: 0; }
.template-list li { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.template-list li > div, .template-list li > span { min-width: 0; flex: 1 1 220px; }
.template-text { white-space: pre-wrap; }
