/* Admin console layout. Mirrors chat-shell's sidebar/pane split but
   the right pane scrolls a long form rather than a message log. */
body.admin-mode {
  display: block;
  min-height: 100vh;
  min-height: 100dvh;
}
/* 100dvh tracks the visible viewport as the mobile URL bar shows/hides,
   keeping the bottom-anchored composer on-screen (iOS Safari/Android
   Chrome render 100vh as the larger toolbar-hidden viewport). */
.admin-shell { display: flex; height: 100vh; height: 100dvh; }
.admin-nav {
  width: 200px;
  flex-shrink: 0;
  border-right: 1px solid #2a2a2a;
  background: #0a0a0a;
  display: flex;
  flex-direction: column;
}
.admin-nav-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #2a2a2a;
}
.admin-nav-header h1 { font-size: 1rem; }
.admin-nav-list { list-style: none; flex: 1; padding-top: 0.5rem; }
.admin-nav-item {
  padding: 0.6rem 1.25rem;
  font-size: 0.8rem;
  color: #aaa;
  cursor: pointer;
  border-left: 2px solid transparent;
}
.admin-nav-item.active {
  border-left-color: #c8a96e;
  background: #131313;
  color: #e8e8e8;
}
.admin-nav-footer {
  border-top: 1px solid #2a2a2a;
  padding: 0.75rem 1.25rem;
  font-size: 0.7rem;
}
.admin-pane {
  flex: 1;
  overflow-y: auto;
  /* Top padding clears the position:fixed .userbar (Profile / Sign out) so a
     pane's top-right control (e.g. the logs/crons Refresh button in .logs-head)
     doesn't render underneath it. */
  padding: 3.25rem 2rem 3rem;
  min-width: 0;
}
.admin-pane h2 {
  font-size: 0.95rem;
  color: #c8a96e;
  letter-spacing: 0.15em;
  margin-bottom: 0.25rem;
}
.admin-loading, .admin-empty {
  color: #555;
  font-size: 0.85rem;
  padding: 2rem 0;
}
.config-group {
  margin-top: 1.25rem;
  border: 1px solid #2a2a2a;
  border-radius: 6px;
  background: #131313;
}
.config-group-header {
  padding: 0.6rem 1rem;
  border-bottom: 1px solid #2a2a2a;
  color: #c8a96e;
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}
.config-row {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid #1a1a1a;
}
.config-row:last-child { border-bottom: none; }
.config-row-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.config-key {
  color: #e8e8e8;
  font-size: 0.85rem;
  font-weight: 500;
}
.config-meta {
  font-size: 0.65rem;
  color: #555;
  letter-spacing: 0.05em;
}
.config-meta .badge {
  display: inline-block;
  padding: 0.05rem 0.4rem;
  margin-left: 0.4rem;
  background: #0a0a0a;
  border: 1px solid #2a2a2a;
  border-radius: 3px;
  color: #888;
}
.config-desc {
  font-size: 0.75rem;
  color: #777;
  margin: 0.3rem 0 0.55rem;
  line-height: 1.4;
}
.config-edit {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.config-input, .config-select {
  background: #0a0a0a;
  color: #e8e8e8;
  border: 1px solid #2a2a2a;
  padding: 0.35rem 0.55rem;
  font-family: inherit;
  font-size: 0.8rem;
  border-radius: 3px;
  min-width: 18rem;
}
.config-input:focus, .config-select:focus {
  outline: none;
  border-color: #c8a96e;
}
/* Locked, identity-provider-sourced fields (Profile pane #profile) */
.config-input:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  border-style: dashed;
}
.config-ok {
  color: #6b8e6b;
  font-size: 0.7rem;
  margin-top: 0.4rem;
}
.config-checkbox {
  width: 1rem;
  height: 1rem;
  accent-color: #c8a96e;
}
/* Prompts pane (admin #prompts) — Gitea #265 */
.prompt-textarea {
  width: 100%;
  box-sizing: border-box;
  min-height: 16rem;
  background: #0a0a0a;
  color: #e8e8e8;
  border: 1px solid #2a2a2a;
  padding: 0.6rem 0.7rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.8rem;
  line-height: 1.5;
  border-radius: 4px;
  resize: vertical;
  white-space: pre-wrap;
}
.prompt-textarea:focus { outline: none; border-color: #c8a96e; }
.prompt-charcount { font-size: 0.65rem; color: #666; }
.prompt-charcount.over { color: #d9534f; }
.prompt-history-text {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.7rem;
  white-space: pre-wrap;
  word-break: break-word;
}
.prompt-history-text .old { color: #b56; }
.prompt-history-text .new { color: #6b8; }
/* Credentials pane (user-land #credentials) — Gitea #233 */
.cred-shell { min-height: 100vh; min-height: 100dvh; }
.cred-pane { max-width: 720px; margin: 0 auto; padding: 3.5rem 1.5rem 3rem; }
.cred-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}
.cred-header h2 {
  font-size: 0.95rem;
  color: #c8a96e;
  letter-spacing: 0.15em;
}
.cred-back { color: #c8a96e; text-decoration: none; font-size: 0.75rem; }
.cred-back:hover { text-decoration: underline; }
.cred-intro { font-size: 0.75rem; color: #777; margin: 0.4rem 0 1.25rem; line-height: 1.5; }
.cred-add { position: relative; display: inline-block; }
.cred-add-menu {
  position: absolute;
  top: 110%;
  left: 0;
  z-index: 20;
  min-width: 160px;
  background: #131313;
  border: 1px solid #2a2a2a;
  border-radius: 6px;
  padding: 0.25rem;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
}
.cred-add-sub { border-left: 1px solid #2a2a2a; margin: 0 0 0.15rem 0.6rem; }
.cred-add-item {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  background: transparent;
  border: none;
  color: #ccc;
  cursor: pointer;
  padding: 0.4rem 0.55rem;
  font-family: inherit;
  font-size: 0.8rem;
  text-align: left;
  border-radius: 4px;
}
.cred-add-item:hover { background: #1d1d1d; color: #e8e8e8; }
.cred-row { display: flex; align-items: center; gap: 0.75rem; }
.cred-icon { font-size: 1rem; }
.cred-row .config-key { flex: 1; min-width: 0; }
.cred-created { font-size: 0.7rem; color: #666; white-space: nowrap; }
.cred-delete { color: #c46e6e; border-color: #5a2a2a; }
.cred-field { display: flex; flex-direction: column; gap: 0.25rem; font-size: 0.75rem; color: #999; }
.cred-field .config-input { width: 100%; min-width: 0; box-sizing: border-box; }
.btn-small {
  margin-top: 0;
  padding: 0.3rem 0.85rem;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  background: transparent;
  cursor: pointer;
  font-family: inherit;
}
.btn-small:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.btn-secondary {
  border-color: #555;
  color: #aaa;
}
.btn-secondary:hover:not(:disabled) {
  background: #2a2a2a;
  color: #e8e8e8;
  border-color: #888;
}
.config-secret {
  font-size: 0.7rem;
  color: #888;
  padding: 0.35rem 0.6rem;
  background: #0a0a0a;
  border: 1px dashed #444;
  border-radius: 3px;
}
.config-error {
  color: #c46e6e;
  font-size: 0.7rem;
  margin-top: 0.4rem;
}
.config-history-toggle {
  background: transparent;
  border: 0;
  color: #6ea0c4;
  font-size: 0.7rem;
  cursor: pointer;
  font-family: inherit;
  padding: 0;
  margin-top: 0.5rem;
}
.config-history-toggle:hover { text-decoration: underline; }
.config-history {
  margin-top: 0.5rem;
  background: #0a0a0a;
  border: 1px solid #1a1a1a;
  border-radius: 3px;
  padding: 0.5rem 0.7rem;
  font-size: 0.7rem;
  color: #aaa;
}
.config-history-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.5rem 1rem;
  padding: 0.25rem 0;
  border-bottom: 1px solid #1a1a1a;
}
.config-history-row:last-child { border-bottom: none; }
.config-history-actor { color: #888; font-size: 0.65rem; }
.config-history-when { color: #666; font-size: 0.65rem; }
.config-history-diff { color: #aaa; }
.config-history-diff .old { color: #c46e6e; }
.config-history-diff .arrow { color: #555; margin: 0 0.3rem; }
.config-history-diff .new { color: #6ec46e; }

/* API Logs panel (Gitea #292) */
.logs-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}
.log-viewport {
  margin-top: 1rem;
  max-height: calc(100vh - 190px);
  overflow-y: auto;
  border: 1px solid #2a2a2a;
  border-radius: 6px;
  background: #0d0d0d;
}
.log-row {
  display: flex;
  gap: 0.75rem;
  padding: 0.3rem 0.75rem;
  border-bottom: 1px solid #1a1a1a;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.72rem;
  line-height: 1.45;
}
.log-row:last-of-type { border-bottom: none; }
.log-time {
  flex: 0 0 auto;
  color: #777;
  white-space: nowrap;
}
.log-line {
  flex: 1;
  min-width: 0;
  color: #ccc;
  white-space: pre-wrap;
  word-break: break-word;
}
.log-row.log-level-warn .log-line { color: #d6b96e; }
.log-row.log-level-error { background: #1a0f0f; }
.log-row.log-level-error .log-line { color: #e08a8a; }
.log-footer {
  padding: 0.75rem;
  text-align: center;
  font-size: 0.75rem;
  color: #888;
}

/* System Crons panel (Gitea #294) */
.cron-crumbs {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}
.cron-crumb {
  color: #c8a96e;
  text-decoration: none;
}
.cron-crumb-current {
  color: #ddd;
  pointer-events: none;
}
.cron-crumb-sep {
  color: #555;
  margin-right: 0.2rem;
}
.cron-table {
  width: 100%;
  margin-top: 1rem;
  border-collapse: collapse;
  font-size: 0.78rem;
}
.cron-table th {
  text-align: left;
  color: #888;
  font-weight: 600;
  border-bottom: 1px solid #2a2a2a;
  padding: 0.4rem 0.6rem;
}
.cron-table td {
  border-bottom: 1px solid #1a1a1a;
  padding: 0.5rem 0.6rem;
  vertical-align: top;
  color: #ccc;
}
.cron-row { cursor: pointer; }
.cron-row:hover td { background: #141414; }
.cron-name { color: #ddd; font-weight: 600; }
.cron-desc { color: #777; font-size: 0.7rem; margin-top: 0.15rem; }
.cron-summary-cell { color: #aaa; }
.cron-status {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.cron-status-success { color: #6ec46e; }
.cron-status-failed { color: #e08a8a; }
.cron-status-running { color: #d6b96e; }
.cron-run-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  margin-top: 1rem;
  font-size: 0.75rem;
  color: #888;
}
.cron-run-summary {
  margin: 0.75rem 0 0.25rem;
  color: #ccc;
  font-size: 0.8rem;
}
.cron-detail {
  margin-top: 0.5rem;
  max-height: calc(100vh - 240px);
  overflow: auto;
  border: 1px solid #2a2a2a;
  border-radius: 6px;
  background: #0d0d0d;
  padding: 0.75rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.72rem;
  line-height: 1.45;
  color: #ccc;
  white-space: pre-wrap;
  word-break: break-word;
}
