/*
 * admin_web/css/admin.css
 * Phase 29.1 — Shared stylesheet for Admin SPA.
 * CSS tokens lifted verbatim from shell.page.ts :root (lines 36-41 — superset).
 * Login-specific classes appended from login.page.ts (lines 39-92).
 */

:root {
  --bg: #0f1117; --surface: #1a1d27; --surface-hover: #22263a;
  --border: #2a2d45; --accent: #7c6af7; --accent-light: #9d8fff;
  --success: #22c55e; --warning: #f59e0b; --error: #ef4444;
  --text: #e2e8f0; --text-muted: #94a3b8; --mono: 'Courier New', monospace;
}
*, *::before, *::after { box-sizing: border-box; }
body, h1, h2, h3, h4, p, ul, ol, figure, blockquote, fieldset, legend { margin: 0; padding: 0; }
body { background: var(--bg); color: var(--text); font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; min-height: 100vh; }
.hamburger { position: fixed; top: 0.75rem; left: 1rem; z-index: 200; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; color: var(--text); cursor: pointer; font-size: 0.85rem; width: 42px; height: 36px; letter-spacing: -1px; padding: 0 0 3px 0; display: flex; align-items: center; justify-content: center; transition: left 0.2s ease, border-color 0.2s; }
.hamburger:hover { border-color: var(--accent); }
.sidebar.open ~ .hamburger, .sidebar.open + .sidebar-backdrop + * + .hamburger { left: 1rem; }
body.sidebar-open .hamburger { left: calc(240px + 1rem); }
.sidebar { position: fixed; left: 0; top: 0; width: 240px; height: 100vh; background: var(--surface); border-right: 1px solid var(--border); z-index: 100; transform: translateX(-240px); transition: transform 0.2s ease; overflow-y: auto; display: flex; flex-direction: column; }
.sidebar.open { transform: translateX(0); }
.sidebar-header { padding: 1.5rem 1rem 1rem; font-size: 0.75rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-muted); border-bottom: 1px solid var(--border); margin-bottom: 0.5rem; }
.sidebar-link { display: block; padding: 0.75rem 1rem; font-size: 0.875rem; color: var(--text-muted); text-decoration: none; transition: background 0.15s, color 0.15s; }
.sidebar-link:hover { background: var(--surface-hover); color: var(--text); }
.sidebar-link.active-link { border-left: 3px solid var(--accent); color: var(--text); background: var(--surface-hover); padding-left: calc(1rem - 3px); }
.sidebar-group-label { padding: 0.5rem 1rem 0.25rem; font-size: 0.65rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-muted); opacity: 0.6; margin-top: 1rem; }
.sidebar-group-label:first-of-type { margin-top: 0.5rem; }
.sidebar-footer { margin-top: auto; padding: 0.75rem 1rem; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 0.5rem; }
.sidebar-footer .uid-label { font-size: 0.7rem; color: var(--success); font-family: var(--mono); overflow: hidden; text-overflow: ellipsis; }
.sidebar-footer input { background: var(--bg); border: 1px solid var(--border); border-radius: 6px; padding: 0.5rem 0.6rem; color: var(--text); font-family: var(--mono); font-size: 0.75rem; outline: none; width: 100%; }
.sidebar-footer input:focus { border-color: var(--accent); }
.sidebar-footer input::placeholder { color: var(--text-muted); }
.sidebar-footer .sidebar-auth-btn { display: block; width: 100%; text-align: center; background: none; border: 1px solid var(--border); border-radius: 6px; color: var(--text-muted); font-size: 0.8rem; padding: 8px 12px; cursor: pointer; transition: border-color 0.15s, color 0.15s; }
.sidebar-footer .sidebar-auth-btn:hover { border-color: var(--accent); color: var(--text); }
.sidebar-footer .sidebar-auth-btn.logout-btn { color: var(--error); border-color: transparent; font-size: 0.75rem; padding: 6px 12px; }
.sidebar-footer .sidebar-auth-btn.logout-btn:hover { border-color: var(--error); }
.sidebar-footer .login-err { font-size: 0.7rem; color: var(--error); min-height: 0.9em; }
.sidebar-backdrop { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); z-index: 99; display: none; }
#dashboard-main { padding: 3rem 2rem 2rem; max-width: 960px; margin: 0 auto; }
#dashboard-main.full-width { max-width: none; padding: 0; }
.section-label { font-size: 0.75rem; font-weight: 600; letter-spacing: 0.1em; color: var(--text-muted); text-transform: uppercase; margin-bottom: 1rem; }
.overview-subheading { font-size: 0.875rem; color: var(--text-muted); margin-bottom: 1.5rem; }
.domain-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 2rem; }
@media (max-width: 640px) { .domain-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 400px) { .domain-grid { grid-template-columns: 1fr; } }
.domain-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 1.5rem; cursor: pointer; transition: border-color 0.2s; display: flex; flex-direction: column; gap: 0.5rem; }
.domain-card:hover { border-color: var(--accent); }
.domain-name { font-size: 0.95rem; font-weight: 600; color: var(--text); }
.domain-card-count { font-size: 0.75rem; color: var(--text-muted); }
.status-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.dot-green { background: var(--success); }
.dot-yellow { background: var(--warning); }
.dot-red { background: var(--error); }
.dot-grey { background: var(--text-muted); }
.endpoints { display: flex; flex-direction: column; gap: 1rem; margin-bottom: 2rem; }
.endpoint-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 1.5rem; transition: border-color 0.2s, background 0.2s; }
.endpoint-card:hover { border-color: var(--accent); background: var(--surface-hover); }
.endpoint-header { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.5rem; }
.method-badge { font-size: 0.75rem; font-weight: 600; padding: 0.25rem 0.5rem; border-radius: 6px; letter-spacing: 0.05em; }
.method-get { background: rgba(34,197,94,0.15); color: #4ade80; }
.method-post { background: rgba(245,158,11,0.15); color: #fbbf24; }
.endpoint-path { font-family: var(--mono); font-size: 0.75rem; color: var(--text-muted); }
.endpoint-title { font-size: 0.95rem; font-weight: 600; flex: 1; }
.endpoint-desc { font-size: 0.875rem; color: var(--text-muted); margin-bottom: 1rem; line-height: 1.6; }
.run-btn { background: linear-gradient(135deg, var(--accent), #6858e8); border: none; border-radius: 8px; color: white; cursor: pointer; font-size: 0.85rem; font-weight: 600; padding: 0.6rem 1.25rem; transition: opacity 0.2s, transform 0.1s; }
.run-btn:hover { opacity: 0.9; } .run-btn:active { transform: scale(0.97); } .run-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.pipeline-btn { background: linear-gradient(135deg, #2d7d46, #1a5c30); border: none; border-radius: 8px; color: white; cursor: pointer; font-size: 0.85rem; font-weight: 600; padding: 0.6rem 1.25rem; transition: opacity 0.2s; margin-right: 0.5rem; }
.pipeline-btn:hover { opacity: 0.9; } .pipeline-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.result-pane { background: var(--bg); border: 1px solid var(--border); border-radius: 8px; font-family: var(--mono); font-size: 0.75rem; line-height: 1.6; margin-top: 1rem; max-height: 200px; overflow-y: auto; padding: 1rem; white-space: pre-wrap; word-break: break-all; display: none; }
.result-pane.visible { display: block; } .result-pane.ok { border-color: var(--success); color: var(--success); } .result-pane.err { border-color: var(--error); color: var(--error); } .result-pane.warn { border-color: var(--warning); color: var(--warning); }
.empty-state { color: var(--text-muted); font-size: 0.875rem; padding: 2rem 0; }
.modal-overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.7); z-index: 1000; align-items: center; justify-content: center; }
.modal-overlay.visible { display: flex; }
.modal-content { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 1.5rem; max-width: 900px; width: 90%; max-height: 80vh; overflow-y: auto; position: relative; }
.modal-content h3 { margin: 0 0 1rem 0; font-size: 1rem; color: var(--accent-light); }
.modal-close { position: absolute; top: 0.75rem; right: 1rem; background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 1.2rem; }
.modal-close:hover { color: var(--text); }
.flow-diagram { background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 1rem; font-family: var(--mono); font-size: 0.75rem; line-height: 1.8; white-space: pre; overflow-x: auto; color: var(--text-muted); }
.flow-btn { background: none; border: 1px solid var(--border); border-radius: 6px; color: var(--accent-light); cursor: pointer; font-size: 0.75rem; padding: 0.25rem 0.5rem; margin-left: 0.5rem; transition: border-color 0.2s; }
.flow-btn:hover { border-color: var(--accent); }
.section-intro { background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--accent); border-radius: 12px; padding: 1.5rem; margin-bottom: 2rem; }
.section-intro-title { font-size: 0.95rem; font-weight: 600; color: var(--text); margin-bottom: 0.5rem; }
.section-intro-body { font-size: 0.875rem; color: var(--text-muted); line-height: 1.6; margin-bottom: 1rem; }
.mermaid-inline { background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 1rem; margin-top: 1rem; overflow-x: auto; }
.mermaid-modal { background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 1rem; overflow-x: auto; }
#page-content > .page-content { display: block; }

/* Login-specific classes (lifted from login.page.ts lines 39-92) */
/* Note: :root block from login.page.ts is a subset — NOT duplicated here.
   The shell :root above is the superset (adds --surface-hover, --success, --warning, --mono). */

.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2.5rem;
  width: 100%;
  max-width: 400px;
  text-align: center;
}
.login-card h1 {
  font-size: 1.25rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 0.5rem;
}
.login-card p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}
.login-card input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  color: var(--text);
  font-size: 0.9rem;
  outline: none;
  margin-bottom: 1rem;
  transition: border-color 0.2s;
}
.login-card input:focus { border-color: var(--accent); }
.login-card button {
  width: 100%;
  background: linear-gradient(135deg, var(--accent), #6858e8);
  border: none;
  border-radius: 8px;
  color: white;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.75rem;
  transition: opacity 0.2s;
}
.login-card button:hover { opacity: 0.9; }
.login-card button:disabled { opacity: 0.4; cursor: not-allowed; }
.error-msg {
  color: var(--error);
  font-size: 0.8rem;
  margin-bottom: 1rem;
}
