*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body { background: #0f172a; color: #e2e8f0; font-family: system-ui, sans-serif; font-size: 14px; }

.nav { background: #0f172a; border-bottom: 1px solid #1e293b; padding: 12px 20px;
       display: flex; align-items: center; justify-content: space-between; }
.nav-brand { color: #6366f1; font-weight: 700; font-size: 16px; }
.nav-links a { color: #94a3b8; text-decoration: none; margin-left: 20px; }
.nav-links a:hover { color: #e2e8f0; }

.login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login-box { background: #1e293b; padding: 40px; border-radius: 8px; width: 320px; text-align: center; }
.login-box h1 { margin-bottom: 24px; color: #6366f1; }
.login-box input { width: 100%; padding: 10px; background: #0f172a; border: 1px solid #334155;
                   color: #e2e8f0; border-radius: 6px; margin-bottom: 12px; }
.login-box button { width: 100%; padding: 10px; background: #6366f1; color: white;
                    border: none; border-radius: 6px; cursor: pointer; }
.error { color: #ef4444; margin-bottom: 12px; font-size: 13px; }

main { padding: 20px; }
.page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.btn { padding: 8px 16px; border-radius: 6px; text-decoration: none; cursor: pointer; border: none; font-size: 14px; }
.btn-primary { background: #6366f1; color: white; }
.btn-secondary { background: #1e293b; color: #94a3b8; border: 1px solid #334155; }

.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; padding: 10px 12px; background: #1e293b; color: #94a3b8; font-weight: 600; }
.table td { padding: 10px 12px; border-bottom: 1px solid #1e293b; }
.table tr:hover td { background: #1e293b; }
.badge { padding: 2px 8px; border-radius: 10px; font-size: 11px; }
.badge-complete { background: #166534; color: #86efac; }
.badge-running  { background: #1e3a5f; color: #93c5fd; }
.badge-pending  { background: #1e293b; color: #94a3b8; }
.badge-failed   { background: #7f1d1d; color: #fca5a5; }
.risk-high   { color: #ef4444; font-weight: 700; }
.risk-medium { color: #f59e0b; font-weight: 700; }
.risk-low    { color: #22c55e; font-weight: 700; }
.empty-state { color: #64748b; padding: 40px 0; }

.form-page { max-width: 600px; }
.form-page h2 { margin-bottom: 20px; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; margin-bottom: 6px; color: #94a3b8; }
.form-group input, .form-group textarea, .form-group select {
  width: 100%; padding: 10px; background: #1e293b; border: 1px solid #334155;
  color: #e2e8f0; border-radius: 6px; }
.form-group select option { background: #1e293b; }
.hint { font-size: 11px; color: #64748b; margin-left: 6px; }

.dashboard { display: flex; height: calc(100vh - 58px); overflow: hidden; }
.report-panel { width: 300px; min-width: 300px; background: #0f172a;
                border-right: 1px solid #1e293b; overflow-y: auto; padding: 16px; }
.report-header h3 { font-size: 14px; margin-bottom: 12px; color: #e2e8f0; }
.risk-box { background: #1e293b; border-radius: 8px; padding: 12px; text-align: center; margin-bottom: 12px; }
.risk-label { font-size: 10px; text-transform: uppercase; letter-spacing: 1px; color: #64748b; }
.risk-value { font-size: 28px; font-weight: 700; color: #e2e8f0; }
.risk-band { display: inline-block; margin-top: 4px; padding: 2px 10px;
             border-radius: 10px; font-size: 11px; font-weight: 700; }
.risk-band.risk-high   { background: #7f1d1d; color: #fca5a5; }
.risk-band.risk-medium { background: #78350f; color: #fde68a; }
.risk-band.risk-low    { background: #14532d; color: #86efac; }

.stats-row { display: flex; gap: 8px; margin-bottom: 16px; }
.stat { flex: 1; background: #1e293b; border-radius: 6px; padding: 8px; text-align: center; }
.stat span { display: block; font-size: 20px; font-weight: 700; }
.stat small { color: #64748b; font-size: 10px; }

.section { margin-bottom: 16px; }
.section-title { font-size: 11px; text-transform: uppercase; letter-spacing: 1px;
                 color: #64748b; margin-bottom: 8px; }
.progress-log { background: #1e293b; border-radius: 6px; padding: 10px;
                max-height: 200px; overflow-y: auto; }
.log-line { font-size: 12px; color: #94a3b8; padding: 2px 0; }
.log-error { color: #ef4444; }

.flag-item { display: flex; gap: 8px; padding: 8px; background: #1e293b;
             border-radius: 6px; margin-bottom: 6px; }
.flag-item.flag-high   { border-left: 3px solid #ef4444; }
.flag-item.flag-medium { border-left: 3px solid #f59e0b; }
.flag-item.flag-info   { border-left: 3px solid #64748b; }
.flag-icon { font-size: 14px; }
.flag-title { font-size: 12px; font-weight: 600; color: #e2e8f0; text-transform: capitalize; }
.flag-desc  { font-size: 11px; color: #94a3b8; line-height: 1.5; margin-top: 2px; }

.alias-item { font-size: 12px; color: #94a3b8; padding: 4px 0; }
.alias-item .arrow { color: #64748b; margin: 0 6px; }

.graph-panel { flex: 1; background: #060d1a; position: relative; display: flex; flex-direction: column; }
.graph-controls { padding: 8px 12px; background: #0f172a; border-bottom: 1px solid #1e293b;
                  display: flex; gap: 8px; }
.filter-btn { padding: 4px 10px; background: #1e293b; color: #94a3b8; border: 1px solid #334155;
              border-radius: 4px; cursor: pointer; font-size: 11px; }
.filter-btn.active { background: #6366f1; color: white; border-color: #6366f1; }
#graph-container { flex: 1; }

.node-inspector { position: absolute; bottom: 40px; right: 12px; width: 260px;
                  background: #1e293b; border: 1px solid #334155; border-radius: 8px;
                  padding: 12px; z-index: 10; }
.inspector-header { display: flex; justify-content: space-between; align-items: center;
                    margin-bottom: 10px; font-weight: 600; color: #e2e8f0; }
.inspector-header button { background: none; border: none; color: #64748b; cursor: pointer; }
#inspector-body p { font-size: 12px; color: #94a3b8; padding: 3px 0; }
#inspector-body a { color: #6366f1; }

.graph-legend { padding: 6px 12px; background: #0f172a; border-top: 1px solid #1e293b;
                display: flex; gap: 14px; font-size: 11px; color: #64748b; }
.legend-item::before { content: '●'; margin-right: 4px; }
.legend-target::before   { color: #ef4444; }
.legend-person::before   { color: #6366f1; }
.legend-active::before   { color: #3b82f6; }
.legend-dissolved::before { color: #475569; }
.legend-proxy::before    { color: #7c3aed; }
