/* Component rules copied from assets/css/dev-spanel.css, with apanel-only selectors.
   Keep source declarations aligned; components parity tests protect the shared look. */
.apanel-page .admin-module-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 14px; }
.apanel-page .admin-module { position: relative; display: flex; align-items: center; min-width: 0; overflow: hidden; border: 1px solid rgba(163,184,202,.16); border-radius: 18px; background: rgba(130,151,170,.055); box-shadow: inset 0 1px 0 rgba(255,255,255,.035); transition: background .22s, border-color .22s; }
.apanel-page .admin-module::before { content: ""; position: absolute; top: 0; left: 0; bottom: 0; width: 4px; background: var(--category-color); opacity: .3; }
.apanel-page .admin-module:hover { background: rgba(153,174,192,.1); border-color: rgba(176,196,213,.3); }
.apanel-page .admin-module-main { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; min-height: 102px; padding: 18px 9px 18px 18px; border: 0; border-radius: inherit; background: none; text-align: left; color: #e3ebf4; cursor: pointer; }
.apanel-page .module-icon { display: grid; place-items: center; flex: 0 0 42px; width: 42px; height: 42px; border-radius: 13px; color: var(--category-color); background: color-mix(in srgb, var(--category-color) 13%, transparent); }
.apanel-page .admin-module-copy { display: flex; flex-direction: column; min-width: 0; }
.apanel-page .admin-module-copy strong { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 650; line-height: 1.5; }
.apanel-page .admin-module-copy > span { margin-top: 4px; color: #91a0b2; font-size: 12px; line-height: 1.65; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.apanel-page .dialog-heading { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 16px 24px; background: #171c24; border-bottom: 1px solid rgba(154,172,192,.16); }
.apanel-page .dialog-heading h2 { display: flex; align-items: center; gap: 10px; font-size: 21px; }
.apanel-page .dialog-content { min-height: min(304px, 45dvh); }
.apanel-page #detail-dialog { border-radius: 16px; border: 1px solid rgb(34,34,48); background: rgba(255,255,255,.04); backdrop-filter: blur(9px) saturate(1.3); -webkit-backdrop-filter: blur(9px) saturate(1.3); box-shadow: 0 25px 50px -12px rgba(0,0,0,.4); }
.apanel-page #detail-dialog .button {
  --dev-button-accent: #94a3b8;
  --dev-button-text: #dce5ef;
  --dev-button-fill: rgba(148,163,184,.07);
  --dev-button-border: rgba(148,163,184,.22);
  box-sizing: border-box; min-height: 42px; min-width: 0; max-width: 100%;
  padding: 10px 16px; gap: 8px; border: 1px solid var(--dev-button-border); border-radius: 12px;
  background: var(--dev-button-fill); color: var(--dev-button-text);
  font-family: inherit; font-size: 13px; font-weight: 600; line-height: 1.35;
  white-space: normal; text-align: center; overflow-wrap: anywhere;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.035); transform: none; filter: none;
  transition: background .2s ease, border-color .2s ease, color .2s ease, box-shadow .2s ease, transform .18s cubic-bezier(.2,.8,.2,1);
}
.apanel-page #detail-dialog .button.danger {
  --dev-button-accent: #fb7185; --dev-button-text: #fecdd3;
  --dev-button-fill: rgba(251,113,133,.08); --dev-button-border: rgba(251,113,133,.27);
}
.apanel-page #detail-dialog .button:not(:disabled):is(:hover,:focus-visible) {
  border-color: color-mix(in srgb,var(--dev-button-accent) 55%,transparent);
  background: color-mix(in srgb,var(--dev-button-accent) 15%,transparent);
  color: var(--dev-button-text); transform: translateY(-1px);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05),0 4px 12px rgba(0,0,0,.14);
}
.apanel-page #detail-dialog .button:focus-visible {
  outline: 2px solid color-mix(in srgb,var(--dev-button-accent) 75%,transparent); outline-offset: 3px;
}
.apanel-page #detail-dialog .button:not(:disabled):active {
  transform: translateY(0) scale(.98); box-shadow: inset 0 1px 4px rgba(0,0,0,.16);
}
.apanel-page .dialog-heading > .icon-button {
  box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; min-height: 36px; padding: 0; flex: 0 0 36px;
  border: 1px solid rgba(148,163,184,.2); border-radius: 11px;
  background: rgba(148,163,184,.06); color: #aebaca;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.025);
  transition: background .2s ease,border-color .2s ease,color .2s ease,transform .18s ease;
}
@media (hover: hover) and (pointer: fine) {
.apanel-page .dialog-heading > .icon-button:not(:disabled):hover {
  background: rgba(251,113,133,.09); border-color: rgba(251,113,133,.3); color: #fda4af; transform: none;
}
}

/* Admin-specific layout adapters; no global spanel stylesheet or navbar overrides. */
.apanel-page { --tone: #5ee0c0; --category-color: #5ee0c0; }
.apanel-page :is([data-symbol="users"],[data-symbol="servers"]) { --category-color: #70c9e8; }
.apanel-page [data-symbol="bolt"] { --category-color: #f2c75c; }
.apanel-page [data-symbol="wallet"] { --category-color: #60d394; }
.apanel-page [data-symbol="settings"] { --category-color: #f36b87; }
.apanel-page [data-symbol="shield"] { --category-color: #14c8df; }
.apanel-page [data-symbol="lock"] { --category-color: #819cf2; }
.apanel-page :is([data-symbol="release"],[data-symbol="book"]) { --category-color: #a89aff; }
.apanel-page :is([data-symbol="bug"],[data-symbol="inbox"]) { --category-color: #ed79b0; }
.apanel-page .green { --tone: #60d394; }
.apanel-page .peach { --tone: #f2b657; }
.apanel-page .blue { --tone: #70c9e8; }
.apanel-page .violet { --tone: #a89aff; }
.apanel-page :is(.hero-card,.metric,.panel,.server-card,.inbox-card) {
  border: 1px solid rgba(163,184,202,.16); border-radius: 18px;
  background: rgba(130,151,170,.055); box-shadow: inset 0 1px 0 rgba(255,255,255,.035);
}
.apanel-page .admin-module { padding: 0 16px 0 0; font: inherit; cursor: pointer; transform: none; }
.apanel-page .admin-module-main { pointer-events: none; }
.apanel-page .admin-module-copy { flex: 1; }
.apanel-page .admin-module-copy strong { display: block; }
.apanel-page .admin-module > .icon { flex: 0 0 17px; color: #91a0b2; }
.apanel-page .admin-module .module-icon { color: var(--category-color); background: color-mix(in srgb,var(--category-color) 13%,transparent); }
.apanel-page .module-icon > .icon { width: 23px; height: 23px; transition: transform .22s; }
.apanel-page .admin-module:is(:hover,:focus-visible) .module-icon > .icon { transform: scale(1.08); }
.apanel-page .admin-module:focus-visible { outline: 2px solid #60d9b3; outline-offset: 3px; }
.apanel-page .admin-module:disabled { opacity: .4; cursor: not-allowed; }
.apanel-page .shortcut { background: rgba(130,151,170,.055); border: 1px solid rgba(163,184,202,.16); border-radius: 18px; }
.apanel-page .shortcut::before { inset: 0 auto 0 0; width: 4px; opacity: .3; }
.apanel-page .shortcut:is(:hover,:focus-visible) { background: rgba(153,174,192,.1); border-color: rgba(176,196,213,.3); }
.apanel-page :is(.shortcut,.inbox-card) .module-icon { --category-color: var(--tone); }
.apanel-page .shortcut:is(:hover,:focus-visible) .module-icon > .icon { transform: scale(1.08); }
.apanel-page .shortcut small { color: #91a0b2; line-height: 1.65; }
.apanel-page .metric-head .icon { color: inherit; }
.apanel-page .metric-icon > .icon { color: var(--tile-accent); }
.apanel-page .service-icon,.apanel-page .event-icon { color: var(--tone); background: color-mix(in srgb,var(--tone) 13%,transparent); border-radius: 13px; }
.apanel-page .service-icon { background: none; border-radius: 0; }
.apanel-page #detail-dialog { width: min(1152px,calc(100% - 40px)); max-height: min(82dvh,920px); min-height: 0; color: #e2e8f0; }
.apanel-page #detail-dialog::backdrop { background: rgba(0,0,0,.6); backdrop-filter: none; -webkit-backdrop-filter: none; }
.apanel-page .dialog-heading .module-icon { width: 42px; height: 42px; flex-basis: 42px; border-radius: 13px; color: var(--category-color); background: color-mix(in srgb,var(--category-color) 15%,transparent); }
.apanel-page .dialog-heading h2 { font-weight: 650; letter-spacing: 0; color: #e2e8f0; }
.apanel-page .dialog-content { color: #e2e8f0; scrollbar-color: #00d6a3 transparent; }
.apanel-page .dialog-footer { padding: 18px 26px; gap: 9px; background: transparent; border-top: 1px solid rgba(154,172,192,.13); }
.apanel-page #detail-dialog .save-button,
.apanel-page #detail-dialog .save-button:is(:hover,:focus,:focus-visible,:active,:disabled) {
  background: #14634f; color: #effff8; border-color: #2e8b70; opacity: 1; filter: none;
}
.apanel-page #detail-dialog .save-button { padding: 0; flex: 0 0 44px; min-width: 44px; min-height: 44px; }
.apanel-page #detail-dialog .button[data-tool="release-new"] { --dev-button-fill: #14634f; --dev-button-border: #2e8b70; --dev-button-text: #effff8; }
.apanel-page #detail-dialog .button[data-tool="release-new"]:is(:hover,:focus-visible) { background: #19765e; }
.apanel-page .admin-field { color: #cbd5e1; font-size: 13px; }
.apanel-page .admin-field :is(input,textarea,select),.apanel-page .search-field {
  background: rgba(255,255,255,.04); color: #e2e8f0; border: 1px solid #333d48; border-radius: 12px;
  outline: 2px solid transparent; outline-offset: 1px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.035); backdrop-filter: blur(9px); -webkit-backdrop-filter: blur(9px);
  caret-color: #60d9b3; color-scheme: dark; -webkit-tap-highlight-color: transparent;
  transition: background-color .22s,border-color .22s,outline-color .22s;
}
.apanel-page .admin-field :is(input,textarea,select) { font-family: inherit; font-size: 14px; -webkit-text-fill-color: currentColor; }
.apanel-page .admin-field :is(input,textarea)::placeholder { color: #94a3b8; opacity: 1; }
.apanel-page .admin-field :is(input,textarea,select):focus,.apanel-page .search-field:focus-within { border-color: #60d9b3; outline-color: rgba(96,217,179,.2); }
.apanel-page .admin-field option { background: #171c24; color: #e2e8f0; }
.apanel-page .search-field input { background: none; border: 0; box-shadow: none; }
.apanel-page .admin-field input:is([type="date"],[type="time"],[type="datetime-local"])::-webkit-datetime-edit { color: #e2e8f0; -webkit-text-fill-color: currentColor; }
.apanel-page .admin-record { background: transparent; backdrop-filter: blur(18px) saturate(1.14); -webkit-backdrop-filter: blur(18px) saturate(1.14); border-color: rgba(148,163,184,.22); transition: border-color .22s,background .22s; }
.apanel-page button.admin-record:is(:hover,:focus-visible) { background: rgba(255,255,255,.04); border-color: rgba(148,163,184,.4); }
.apanel-page .admin-record > .icon { transform-origin: center; }
@media (max-width: 1000px) { .apanel-page .admin-module-grid { grid-template-columns: repeat(2,minmax(0,1fr)); } }
@media (max-width: 600px) {
  .apanel-page .admin-module-grid { grid-template-columns: minmax(0,1fr); gap: 12px; }
  .apanel-page #detail-dialog { width: calc(100% - 20px); max-height: min(90dvh,calc(100dvh - 24px - env(safe-area-inset-top) - env(safe-area-inset-bottom))); }
  .apanel-page :is(.dialog-heading,.dialog-content,.dialog-footer) { padding: 17px; }
  .apanel-page .dialog-heading { gap: 12px; }
  .apanel-page .dialog-heading h2 { font-size: 19px; overflow-wrap: anywhere; }
  .apanel-page .admin-field :is(input,textarea,select) { font-size: 16px; }
  .apanel-page .admin-module-copy strong { overflow-wrap: anywhere; }
}
@media (hover: none) and (pointer: coarse) {
  .apanel-page #detail-dialog::backdrop { background: transparent; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
}
@media (prefers-reduced-motion: reduce) {
  .apanel-page :is(#detail-dialog[open],#detail-dialog::backdrop) { animation: none; }
  .apanel-page :is(.admin-module,.module-icon > .icon,.admin-field input,.admin-field textarea,.admin-field select,.admin-record,.search-field,#detail-dialog .button) { transition: none; }
  .apanel-page :is(.admin-module,.shortcut):is(:hover,:focus-visible) .module-icon > .icon { transform: none; }
}
html[data-motion="reduce"] .apanel-page :is(#detail-dialog[open],#detail-dialog::backdrop) { animation: none; }

/* Same notification surfaces and viewport placement as the server panel. */
.apanel-page #toast { inset: auto 22px 22px auto; margin: 0; left: auto; transform: none; width: max-content; max-width: min(360px,calc(100vw - 32px)); box-sizing: border-box; padding: 13px 15px; border: 2px solid rgba(var(--ui-accent-rgb, 0, 224, 164),.36); border-radius: 18px; background: transparent; color: #dffbf2; box-shadow: 0 24px 60px rgba(0,0,0,.34); font-family: inherit; font-size: 13px; line-height: 1.5; }
.apanel-page #toast[data-tone="error"] { border-color: rgba(248,113,113,.42); color: #fecdd3; }
.apanel-page #toast[data-tone="warning"] { border-color: rgba(250,204,21,.42); color: #fde68a; }
.apanel-page #toast > .icon { color: currentColor; margin-top: 2px; flex: 0 0 17px; }
.apanel-page #toast > span { min-width: 0; overflow-wrap: anywhere; }
.apanel-page #toast:not([hidden]) { align-items: flex-start; animation: admin-toast-in .24s ease both; }
.apanel-page #toast.is-leaving { animation: admin-toast-in .24s ease reverse both; }
.apanel-page .workspace-navbar-alert.is-toast { background: transparent; box-shadow: 0 24px 60px rgba(0,0,0,.34); }
@keyframes admin-toast-in { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
@media (max-width: 768px) {
  .apanel-page #toast { top: calc(env(safe-area-inset-top,0px) + 14px); right: 14px; bottom: auto; left: 14px; width: auto; max-width: none; }
}
@media (prefers-reduced-motion: reduce) {
  .apanel-page #toast:not([hidden]) { animation: none; }
}
html[data-motion="reduce"] .apanel-page #toast:not([hidden]) { animation: none; }
