:root {
  --bg: #070913;
  --panel: #0e1526;
  --panel-hover: #141f38;
  --border: rgba(255, 255, 255, 0.08);
  --border-focus: #7c3aed;
  --text: #f8fafc;
  --muted: #94a3b8;
  --subtle: #64748b;
  
  --purple: #8b5cf6;
  --cyan: #38bdf8;
  --green: #10b981;
  --red: #f43f5e;
  --blue: #3b82f6;
  
  --font-main: 'Plus Jakarta Sans', system-ui, sans-serif;
  --font-mono: 'Space Grotesk', monospace;
  --radius: 12px;
}

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

body {
  background: var(--bg);
  background-image: radial-gradient(circle at 10% 0%, rgba(139, 92, 246, 0.12) 0%, transparent 40%),
                    radial-gradient(circle at 90% 10%, rgba(56, 189, 248, 0.08) 0%, transparent 35%);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--font-main);
  min-height: 100vh;
  padding-left: 250px;
}

.shell {
  width: min(1280px, calc(100% - 48px));
  margin: 0 auto;
  padding: 36px 0 60px;
}

.screen { display: none; }
.screen.active { display: block; animation: fadeIn 0.2s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

/* Topbar */
.topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.eyebrow-tag {
  font-size: 11px;
  font-weight: 800;
  color: #38bdf8;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 4px;
}

.topbar h1 {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #fff;
}

.subtitle {
  color: var(--muted);
  font-size: 14px;
  margin-top: 4px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Botões */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  font-family: var(--font-main);
  font-size: 13px;
  font-weight: 700;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-primary { background: #7c3aed; color: #fff; }
.btn-primary:hover { background: #6d28d9; transform: translateY(-1px); }

.btn-sync {
  background: rgba(56, 189, 248, 0.1);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.25);
}
.btn-sync:hover { background: rgba(56, 189, 248, 0.2); }

.btn-ghost {
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }

.btn-stop {
  background: rgba(244, 63, 94, 0.1);
  color: #fb7185;
  border: 1px solid rgba(244, 63, 94, 0.25);
}
.btn-stop:hover { background: rgba(244, 63, 94, 0.2); }

.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-lg { padding: 12px 20px; font-size: 14px; }

/* Metrics Grid */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 28px;
}

.metric-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
}

.metric-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.metric-card strong {
  display: block;
  font-size: 32px;
  font-weight: 800;
  margin: 6px 0;
  color: #fff;
  font-family: var(--font-mono);
}

.metric-card strong.metric-date { font-size: 18px; margin-top: 10px; }

.metric-tags { display: flex; gap: 6px; }

.tag {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 99px;
}
.tag.online { background: rgba(16, 185, 129, 0.15); color: #34d399; }
.tag.offline { background: rgba(244, 63, 94, 0.15); color: #fb7185; }
.tag.purple { background: rgba(139, 92, 246, 0.15); color: #c084fc; }
.tag.blue { background: rgba(59, 130, 246, 0.15); color: #60a5fa; }
.tag.green { background: rgba(16, 185, 129, 0.15); color: #34d399; }
.tag.cyan { background: rgba(56, 189, 248, 0.15); color: #38bdf8; }

/* Toolbar */
.toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.search-box {
  flex: 1;
  min-width: 240px;
  position: relative;
}

.search-box .icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--subtle);
  font-size: 13px;
}

.search-box input {
  width: 100%;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px 10px 36px;
  color: #fff;
  font-family: var(--font-main);
  font-size: 13px;
  outline: none;
}
.search-box input:focus { border-color: var(--purple); }

.filter-pills { display: flex; gap: 6px; }

.pill {
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 7px 12px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}
.pill:hover { background: var(--panel-hover); color: #fff; }
.pill.active { background: #7c3aed; color: #fff; border-color: #7c3aed; }

.select-box {
  background: var(--panel);
  border: 1px solid var(--border);
  color: #fff;
  padding: 8px 12px;
  border-radius: 8px;
  font-family: var(--font-main);
  font-size: 12px;
  font-weight: 600;
  outline: none;
  cursor: pointer;
}
.select-box option { background: #0e1526; }

.view-switch {
  display: inline-flex;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 2px;
}

.view-btn {
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 700;
  border: 0;
  background: transparent;
  color: var(--muted);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.view-btn.active { background: #202b44; color: #38bdf8; }

.counter-badge {
  font-size: 12px;
  color: var(--muted);
  margin-left: auto;
  font-weight: 600;
}
.counter-badge span { color: #fff; font-weight: 800; }

/* Grid Mídias */
.medias-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.media-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
  transition: all 0.2s ease;
}
.media-card:hover {
  border-color: rgba(139, 92, 246, 0.4);
  transform: translateY(-2px);
  background: var(--panel-hover);
}

.media-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.media-card-top h4 {
  font-size: 14px;
  font-weight: 700;
  color: #f1f5f9;
  line-height: 1.3;
}

.duration-chip {
  background: rgba(139, 92, 246, 0.15);
  color: #c084fc;
  font-size: 11px;
  font-weight: 800;
  padding: 3px 6px;
  border-radius: 4px;
  white-space: nowrap;
}

.media-card-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: var(--muted);
}
.media-card-meta div { display: flex; justify-content: space-between; }
.media-card-meta strong { color: #38bdf8; }

/* Data Tables */
.data-table-container {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.data-table { width: 100%; border-collapse: collapse; text-align: left; }
.data-table th {
  background: rgba(0, 0, 0, 0.3);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}
.data-table td { padding: 14px 16px; font-size: 13px; border-bottom: 1px solid var(--border); }
.data-table tr:hover td { background: rgba(255, 255, 255, 0.02); }

.status-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 99px;
}
.status-tag.online { background: rgba(16, 185, 129, 0.12); color: #34d399; }
.status-tag.offline { background: rgba(244, 63, 94, 0.12); color: #fb7185; }
.status-tag.eval { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }
.status-tag.live { background: rgba(56, 189, 248, 0.15); color: #38bdf8; }
.status-tag.done { background: rgba(16, 185, 129, 0.15); color: #34d399; }

.badge-group {
  background: rgba(255, 255, 255, 0.06);
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
}

.loading { text-align: center; padding: 30px; color: var(--muted); }

/* Seções e Módulos */
.section-block { margin-bottom: 28px; }
.section-title h2 { font-size: 18px; font-weight: 700; margin-bottom: 14px; }

.module-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.mod-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
}

.mod-head {
  display: flex;
  justify-content: space-between;
  margin-bottom: 14px;
}
.mod-head h3 { font-size: 18px; font-weight: 700; }
.mod-head p { font-size: 12px; color: var(--muted); margin-top: 2px; }

.mod-actions { display: flex; gap: 8px; }
.mod-actions .btn { flex: 1; justify-content: center; }

/* Eventos */
.events-list { display: flex; flex-direction: column; gap: 6px; }
.event-row {
  display: grid;
  grid-template-columns: 80px 1fr auto;
  align-items: center;
  gap: 12px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 12px;
}
.event-row strong { font-size: 13px; }
.event-row p { color: var(--muted); }
.event-row time { color: var(--subtle); font-size: 11px; }

/* SGP Box */
.sgp-box {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.15), rgba(15, 23, 42, 0.6));
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: var(--radius);
  padding: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.sgp-header { display: flex; align-items: center; gap: 16px; }
.sgp-icon-big { font-size: 40px; }
.sgp-header h2 { font-size: 20px; font-weight: 700; }
.sgp-header p { color: var(--muted); font-size: 13px; margin: 4px 0 8px; }
.sgp-header code { background: rgba(0, 0, 0, 0.3); padding: 3px 6px; border-radius: 4px; font-size: 11px; color: #93c5fd; }

/* AI Section */
.ai-quick-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 20px;
}

.ai-action-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  color: #fff;
  cursor: pointer;
  text-align: left;
  font-family: var(--font-main);
  transition: all 0.2s ease;
}
.ai-action-btn:hover {
  background: var(--panel-hover);
  border-color: rgba(56, 189, 248, 0.4);
  transform: translateY(-2px);
}

.ai-btn-icon {
  font-size: 24px;
  background: rgba(56, 189, 248, 0.1);
  padding: 10px;
  border-radius: 8px;
}
.ai-action-btn strong { display: block; font-size: 14px; margin-bottom: 2px; }
.ai-action-btn small { color: var(--muted); font-size: 12px; }

.ai-chat-box { display: flex; flex-direction: column; gap: 16px; }
.ai-input-row { display: flex; gap: 10px; }
.ai-input-row input {
  flex: 1;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 18px;
  color: #fff;
  font-family: var(--font-main);
  font-size: 14px;
  outline: none;
}
.ai-input-row input:focus { border-color: #38bdf8; }

.ai-response-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  min-height: 200px;
}

.ai-response-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}

.ai-badge { font-size: 12px; font-weight: 800; color: #38bdf8; letter-spacing: 0.05em; }
.ai-time { font-size: 12px; color: var(--subtle); }
.ai-response-body { font-size: 14px; line-height: 1.7; color: #e2e8f0; }

/* === ESTEIRA SGP PIPELINE UI === */
.pipeline-stepper-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 18px;
  margin-bottom: 24px;
}

.step-nav-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  background: transparent;
  border: 0;
  color: var(--muted);
  cursor: pointer;
  padding: 8px 14px;
  border-radius: 8px;
  font-family: var(--font-main);
  transition: all 0.2s ease;
  text-align: left;
}
.step-nav-btn:hover { background: rgba(255, 255, 255, 0.04); color: #fff; }
.step-nav-btn.active {
  background: rgba(124, 58, 237, 0.15);
  color: #fff;
  border: 1px solid rgba(124, 58, 237, 0.4);
}

.step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 12px;
  color: #38bdf8;
}
.step-nav-btn.active .step-num {
  background: #7c3aed;
  color: #fff;
}

.step-info strong { display: block; font-size: 13px; }
.step-info small { display: block; font-size: 11px; color: var(--subtle); }
.step-arrow { color: var(--subtle); font-size: 14px; }

.pipeline-stage-view { display: none; }
.pipeline-stage-view.active { display: block; animation: fadeIn 0.2s ease; }

.stage-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}
.stage-card-head { margin-bottom: 18px; }
.stage-card-head h3 { font-size: 17px; font-weight: 700; color: #38bdf8; }
.stage-card-head p { color: var(--muted); font-size: 13px; margin-top: 4px; }

.pipeline-textarea {
  width: 100%;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  color: #fff;
  font-family: var(--font-main);
  font-size: 14px;
  min-height: 160px;
  resize: vertical;
  outline: none;
  line-height: 1.6;
}
.pipeline-textarea:focus { border-color: #a855f7; }

.stage-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  flex-wrap: wrap;
}

/* Live Monitor Card */
.live-monitor-card {
  background: #090e1a;
  border: 1px solid rgba(56, 189, 248, 0.4);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
}

.live-monitor-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}

.live-pulse-badge {
  display: inline-block;
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  font-size: 11px;
  font-weight: 800;
  padding: 4px 8px;
  border-radius: 99px;
  margin-right: 8px;
}

.live-terminal-box {
  background: #030712;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
}
.terminal-title {
  font-size: 11px;
  font-weight: 700;
  color: #10b981;
  margin-bottom: 8px;
  letter-spacing: 0.05em;
}
.live-terminal-box pre {
  font-family: var(--font-mono);
  font-size: 12px;
  color: #e2e8f0;
  line-height: 1.6;
  max-height: 280px;
  overflow-y: auto;
  white-space: pre-wrap;
}

/* SGP Form Grid */
.form-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 14px;
}
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-size: 12px; font-weight: 600; color: var(--muted); }
.form-group label .req { color: #f43f5e; font-weight: 700; }
.form-group input, .form-group select, .form-group textarea {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  color: #fff;
  font-family: var(--font-main);
  font-size: 13px;
  outline: none;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  border-color: #38bdf8;
}
.col-12 { grid-column: span 12; }
.col-8 { grid-column: span 8; }
.col-7 { grid-column: span 7; }
.col-6 { grid-column: span 6; }
.col-4 { grid-column: span 4; }
.col-3 { grid-column: span 3; }
.col-2 { grid-column: span 2; }

@media (max-width: 900px) {
  .col-8, .col-7, .col-6, .col-4, .col-3, .col-2 { grid-column: span 12; }
  .pipeline-stepper-bar { flex-direction: column; align-items: flex-start; }
  .step-arrow { display: none; }
}

/* Toast */
#toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  background: #fff;
  color: #0f172a;
  padding: 12px 18px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 13px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: all 0.2s ease;
  z-index: 1000;
}
#toast.show { opacity: 1; transform: translateY(0); }

/* === FORMULÁRIO IDÊNTICO AO SGP (DARK THEME) === */
.sgp-theme-form-wrapper {
  background: #1e2227;
  border: 1px solid #33383e;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  font-family: Arial, sans-serif;
}

.sgp-fieldset {
  margin-bottom: 2px;
  border-bottom: 1px solid #2d3238;
}

.sgp-fieldset-header {
  background: #33383e;
  color: #ffffff;
  font-size: 14px;
  font-weight: bold;
  padding: 10px 16px;
  letter-spacing: 0.02em;
}

.sgp-fieldset-body {
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #22262b;
}

.sgp-form-row {
  display: flex;
  align-items: flex-start;
  min-height: 32px;
}

.sgp-label {
  width: 180px;
  min-width: 180px;
  font-size: 13px;
  font-weight: bold;
  color: #d1d5db;
  padding-top: 6px;
}
.sgp-label .req { color: #f87171; font-weight: bold; }

.sgp-input-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sgp-input, .sgp-select, .sgp-textarea {
  background: #181b1f;
  border: 1px solid #3d444d;
  color: #f3f4f6;
  border-radius: 4px;
  padding: 6px 10px;
  font-size: 13px;
  outline: none;
  font-family: inherit;
}
.sgp-input:focus, .sgp-select:focus, .sgp-textarea:focus {
  border-color: #60a5fa;
  background: #14171a;
}

.sgp-input.full { width: 100%; max-width: 650px; }
.sgp-input.medium { width: 260px; }
.sgp-input.small { width: 140px; }

.sgp-select.full { width: 100%; max-width: 650px; }
.sgp-select.small { width: 140px; }

.sgp-textarea.full { width: 100%; max-width: 650px; resize: vertical; }

.sgp-input-with-btn {
  display: flex;
  align-items: center;
  gap: 6px;
}

.sgp-btn-search {
  background: #374151;
  border: 1px solid #4b5563;
  color: #fff;
  border-radius: 4px;
  padding: 5px 8px;
  font-size: 12px;
  cursor: pointer;
}
.sgp-btn-search:hover { background: #4b5563; }

.sgp-helper-text {
  font-size: 11px;
  color: #f59e0b; /* Amber/Orange igual ao SGP */
  margin-top: 2px;
}

.sgp-checkbox {
  width: 16px;
  height: 16px;
  margin-top: 4px;
  accent-color: #10b981;
}

.sgp-listbox {
  background: #d1d5db;
  color: #111827;
  border: 1px solid #9ca3af;
  border-radius: 4px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 500;
  max-width: 320px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sgp-form-footer {
  background: #2b3036;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.sgp-btn-cadastrar {
  background: #2563eb;
  color: #ffffff;
  border: 0;
  padding: 10px 22px;
  font-size: 14px;
  font-weight: bold;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.sgp-btn-cadastrar:hover { background: #1d4ed8; }
.sgp-btn-cadastrar.green {
  background: #16a34a;
}
.sgp-btn-cadastrar.green:hover { background: #15803d; }

@media (max-width: 800px) {
  .sgp-form-row { flex-direction: column; gap: 4px; }
  .sgp-label { width: 100%; min-width: unset; }
  .sgp-input.full, .sgp-select.full, .sgp-textarea.full { max-width: 100%; }
}

/* Modal Popup de Validação */
.val-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  display: grid;
  place-items: center;
  z-index: 9999;
  animation: fadeIn 0.15s ease;
}

.val-modal-box {
  background: #181b22;
  border: 1px solid #f43f5e;
  border-radius: 12px;
  width: min(520px, calc(100% - 32px));
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 0 0 30px rgba(244, 63, 94, 0.2);
  overflow: hidden;
}

.val-modal-head {
  background: rgba(244, 63, 94, 0.12);
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  border-bottom: 1px solid rgba(244, 63, 94, 0.25);
}

.val-modal-icon {
  font-size: 28px;
}

.val-modal-head h3 {
  font-size: 16px;
  font-weight: 800;
  color: #fb7185;
}

.val-modal-head p {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.val-modal-body {
  padding: 20px;
  max-height: 320px;
  overflow-y: auto;
}

.val-modal-body ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.val-modal-body li {
  background: rgba(244, 63, 94, 0.08);
  border-left: 3px solid #f43f5e;
  padding: 10px 14px;
  border-radius: 4px;
  font-size: 13px;
  color: #fecdd3;
  display: flex;
  align-items: center;
  gap: 8px;
}

.val-modal-body li::before {
  content: "❌";
  font-size: 12px;
}

.val-modal-foot {
  background: #0f1218;
  padding: 14px 20px;
  display: flex;
  justify-content: flex-end;
  border-top: 1px solid var(--border);
}

/* Destaque de campo inválido */
.sgp-input-error {
  border-color: #f43f5e !important;
  background: rgba(244, 63, 94, 0.12) !important;
  box-shadow: 0 0 0 2px rgba(244, 63, 94, 0.25) !important;
}


/* Pipeline Stages Visibility */
.pipeline-stage {
  display: none !important;
}
.pipeline-stage.active {
  display: block !important;
}


/* Visibility of pipeline stages */
.pipeline-stage-view {
  display: none;
}
.pipeline-stage-view.active {
  display: block !important;
}


/* Multimodal Grid & Dropzone Styles */
.multimodal-entry-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 14px;
}

@media (max-width: 900px) {
  .multimodal-entry-grid {
    grid-template-columns: 1fr;
  }
}

.multimodal-dropzone-box {
  background: #11141d;
  border: 2px dashed #475569;
  border-radius: 12px;
  padding: 24px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  min-height: 220px;
}

.multimodal-dropzone-box:hover, .multimodal-dropzone-box.dragover {
  border-color: #8b5cf6;
  background: rgba(139, 92, 246, 0.08);
}

.dropzone-inner .dropzone-icon {
  font-size: 38px;
  display: block;
  margin-bottom: 10px;
}

.dropzone-inner h4 {
  font-size: 15px;
  font-weight: 700;
  color: #f1f5f9;
  margin: 0 0 4px 0;
}

.dropzone-inner p {
  font-size: 12px;
  color: #94a3b8;
  margin: 0 0 14px 0;
}

.ctrl-v-badge {
  display: inline-block;
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: #38bdf8;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
}

.files-preview-list {
  width: 100%;
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.file-preview-item {
  background: #181d2a;
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: #e2e8f0;
}

.file-preview-item .file-info {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-preview-item .file-remove-btn {
  background: none;
  border: none;
  color: #f43f5e;
  cursor: pointer;
  font-size: 16px;
  padding: 2px 6px;
}

.multimodal-text-box {
  display: flex;
  flex-direction: column;
}

.multimodal-label {
  font-size: 13px;
  font-weight: 700;
  color: #cbd5e1;
  margin-bottom: 8px;
}

.multimodal-textarea {
  background: #11141d;
  border: 1px solid #334155;
  border-radius: 12px;
  color: #ffffff;
  padding: 16px;
  font-size: 14px;
  flex: 1;
  min-height: 180px;
  resize: vertical;
  font-family: inherit;
}

.multimodal-textarea:focus {
  outline: none;
  border-color: #8b5cf6;
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2);
}


/* Submenu & Screen Isolation Styles */
.app-screen {
  display: none !important;
}

.app-screen.active {
  display: block !important;
}

.nav-sub-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px 8px 32px;
  margin: 2px 8px;
  border-radius: 8px;
  color: #94a3b8;
  text-decoration: none;
  font-size: 12.5px;
  font-weight: 600;
  transition: all 0.15s ease;
  position: relative;
}

.nav-sub-item:hover {
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.08);
}

.nav-sub-item.active {
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.3);
  font-weight: 700;
}

.nav-sub-item .badge {
  margin-left: auto;
  font-size: 11px;
  padding: 2px 7px;
  background: #1e293b;
  border-radius: 10px;
  color: #94a3b8;
}

.nav-sub-item.active .badge {
  background: #38bdf8;
  color: #0f172a;
}


/* ==========================================================================
   MODERN SIDEBAR NAVIGATION (INSPIRADO NO SISTEMA 117)
   ========================================================================== */
.sidebar nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 0;
}

.nav-section-title {
  font-size: 11px;
  font-weight: 800;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 12px 14px 4px 14px;
  user-select: none;
}

.nav-item, .nav-sub-item {
  all: unset;
  display: flex;
  align-items: center;
  gap: 10px;
  width: calc(100% - 16px);
  margin: 2px 8px;
  box-sizing: border-box;
  cursor: pointer;
  font-family: inherit;
  border-radius: 10px;
  transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
  border: 1px solid transparent;
}

.nav-item {
  padding: 10px 14px;
  font-size: 13.5px;
  font-weight: 600;
  color: #cbd5e1;
  background: transparent;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #f8fafc;
  transform: translateX(2px);
}

.nav-item.active {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.22), rgba(99, 102, 241, 0.22));
  border: 1px solid rgba(139, 92, 246, 0.45);
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 4px 18px rgba(139, 92, 246, 0.2);
}

.nav-item.active .icon {
  filter: drop-shadow(0 0 6px rgba(139, 92, 246, 0.6));
}

.nav-sub-item {
  padding: 8px 12px 8px 30px;
  font-size: 12.5px;
  font-weight: 500;
  color: #94a3b8;
  background: transparent;
}

.nav-sub-item:hover {
  background: rgba(56, 189, 248, 0.08);
  color: #38bdf8;
  transform: translateX(3px);
}

.nav-sub-item.active {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.18), rgba(99, 102, 241, 0.18));
  border: 1px solid rgba(56, 189, 248, 0.4);
  color: #38bdf8;
  font-weight: 700;
  box-shadow: 0 4px 15px rgba(56, 189, 248, 0.18);
}

.nav-item .badge, .nav-sub-item .badge {
  margin-left: auto;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  background: #1e293b;
  border-radius: 12px;
  color: #94a3b8;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.nav-item.active .badge {
  background: #8b5cf6;
  color: #ffffff;
}

.nav-sub-item.active .badge {
  background: #38bdf8;
  color: #090d16;
}


/* ==========================================================================
   PERSONALIZAR MENU LATERAL (ESTILO SERVER 117)
   ========================================================================== */
.menu-customizer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 16px;
}

.menu-customizer-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.section-config-card {
  background: #0f1422;
  border: 1px solid #1e293b;
  border-radius: 14px;
  padding: 18px;
  margin-bottom: 20px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.section-config-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 12px;
  margin-bottom: 14px;
  border-bottom: 1px solid #1e293b;
}

.section-title-input {
  background: #182032;
  border: 1px solid #334155;
  border-radius: 8px;
  color: #fff;
  font-weight: 800;
  font-size: 15px;
  padding: 6px 12px;
  width: 280px;
}

.menu-item-row {
  background: #141b2d;
  border: 1px solid #1e293b;
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: all 0.2s ease;
}

.menu-item-row:hover {
  border-color: #38bdf8;
  box-shadow: 0 4px 15px rgba(56, 189, 248, 0.1);
}

.menu-item-main-line {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.menu-item-sub-line {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  padding-top: 8px;
  border-top: 1px dashed rgba(255, 255, 255, 0.06);
  font-size: 12px;
}

.menu-item-input {
  background: #0b0f19;
  border: 1px solid #334155;
  border-radius: 6px;
  color: #f8fafc;
  padding: 6px 10px;
  font-size: 13px;
}

.menu-item-select {
  background: #0b0f19;
  border: 1px solid #334155;
  border-radius: 6px;
  color: #f8fafc;
  padding: 6px 8px;
  font-size: 12px;
  cursor: pointer;
}

.menu-toggle-btn {
  background: #1e293b;
  border: 1px solid #334155;
  color: #94a3b8;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.menu-toggle-btn.active {
  background: rgba(34, 197, 94, 0.15);
  border-color: rgba(34, 197, 94, 0.4);
  color: #4ade80;
  font-weight: 700;
}

.menu-floating-bar {
  position: sticky;
  bottom: 20px;
  background: rgba(15, 23, 42, 0.95);
  border: 2px solid #38bdf8;
  border-radius: 14px;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  backdrop-filter: blur(12px);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.8);
  margin-top: 30px;
  z-index: 9999;
}


/* ==========================================================================
   PALETA COMPLETA DE CORES DOS MENUS (ESTILO 117)
   ========================================================================== */
.menu-color-default {
  color: #cbd5e1 !important;
}
.menu-color-white {
  color: #ffffff !important;
}
.menu-color-cyan {
  color: #38bdf8 !important;
}
.menu-color-emerald {
  color: #10b981 !important;
}
.menu-color-purple {
  color: #c084fc !important;
}
.menu-color-amber {
  color: #fbbf24 !important;
}
.menu-color-pink {
  color: #f472b6 !important;
}
.menu-color-red {
  color: #f87171 !important;
}
.menu-color-orange {
  color: #fb923c !important;
}

/* Hover e Efeito de Destaque nas Cores */
.nav-item.menu-color-cyan:hover, .nav-sub-item.menu-color-cyan:hover {
  background: rgba(56, 189, 248, 0.12) !important;
  color: #38bdf8 !important;
}
.nav-item.menu-color-emerald:hover, .nav-sub-item.menu-color-emerald:hover {
  background: rgba(16, 185, 129, 0.12) !important;
  color: #10b981 !important;
}
.nav-item.menu-color-purple:hover, .nav-sub-item.menu-color-purple:hover {
  background: rgba(192, 132, 252, 0.12) !important;
  color: #c084fc !important;
}
.nav-item.menu-color-pink:hover, .nav-sub-item.menu-color-pink:hover {
  background: rgba(244, 114, 182, 0.12) !important;
  color: #f472b6 !important;
}
.nav-item.menu-color-amber:hover, .nav-sub-item.menu-color-amber:hover {
  background: rgba(251, 191, 36, 0.12) !important;
  color: #fbbf24 !important;
}

/* Submenu limpo (sem caractere de seta) */
.nav-sub-item {
  all: unset;
  display: flex;
  align-items: center;
  gap: 10px;
  width: calc(100% - 24px);
  margin: 2px 8px 2px 16px;
  padding: 8px 12px 8px 20px;
  box-sizing: border-box;
  cursor: pointer;
  font-family: inherit;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
  border-left: 2px solid rgba(255, 255, 255, 0.1);
}

.nav-sub-item:hover {
  border-left-color: #38bdf8;
  transform: translateX(3px);
}

.nav-sub-item.active {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.18), rgba(99, 102, 241, 0.18));
  border: 1px solid rgba(56, 189, 248, 0.4);
  border-left: 3px solid #38bdf8;
  color: #38bdf8 !important;
  font-weight: 700;
}

.screen {
  display: none !important;
}
.screen.active {
  display: block !important;
}



/* Step Nav Buttons Enhancement */
.pipeline-nav {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
}
.step-nav-btn {
  background: #0f1422;
  border: 1px solid #1e293b;
  border-radius: 12px;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer !important;
  transition: all 0.2s ease;
  user-select: none;
}
.step-nav-btn * {
  pointer-events: none;
}
.step-nav-btn:hover {
  background: #1e293b !important;
  border-color: #38bdf8 !important;
  transform: translateY(-1px);
}
.step-nav-btn.active {
  background: #181d30 !important;
  border-color: #8b5cf6 !important;
  box-shadow: 0 0 15px rgba(139, 92, 246, 0.25);
}
.step-nav-btn .step-num {
  background: #1e293b;
  color: #94a3b8;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 13px;
}
.step-nav-btn.active .step-num {
  background: #8b5cf6;
  color: #fff;
}
.step-nav-btn .step-info strong {
  display: block;
  color: #f8fafc;
  font-size: 13px;
}
.step-nav-btn .step-info small {
  color: #94a3b8;
  font-size: 11px;
}



/* ==========================================================================
   TEMA E FORMULÁRIO OFICIAL SGP (PIXEL-PERFECT)
   ========================================================================== */
.sgp-official-card {
  background: #1e1e1e;
  border: 1px solid #333333;
  border-radius: 6px;
  overflow: hidden;
  margin-top: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7);
  font-family: Arial, Helvetica, sans-serif;
}
.sgp-official-header {
  background: #2b2b2b;
  padding: 12px 18px;
  border-bottom: 1px solid #3a3a3a;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.sgp-official-header h3 {
  margin: 0;
  color: #ffffff;
  font-size: 16px;
  font-weight: bold;
}
.sgp-section-header {
  background: #2d2d2d;
  color: #f1f1f1;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: bold;
  border-top: 1px solid #3d3d3d;
  border-bottom: 1px solid #3d3d3d;
  letter-spacing: 0.3px;
}
.sgp-form-table {
  width: 100%;
  border-collapse: collapse;
  background: #1e1e1e;
}
.sgp-form-table tr {
  border-bottom: 1px solid #282828;
}
.sgp-form-table tr:hover {
  background: rgba(255, 255, 255, 0.02);
}
.sgp-form-label {
  width: 220px;
  padding: 8px 16px;
  color: #cfcfcf;
  font-size: 12.5px;
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
}
.sgp-form-label .req {
  color: #ff5500;
  font-weight: bold;
  margin-left: 2px;
}
.sgp-form-field {
  padding: 6px 16px;
  vertical-align: middle;
}
.sgp-input-dark {
  background: #121212 !important;
  border: 1px solid #444444 !important;
  color: #efefef !important;
  padding: 6px 10px !important;
  font-size: 12.5px !important;
  border-radius: 3px !important;
  outline: none !important;
  box-sizing: border-box;
}
.sgp-input-dark:focus {
  border-color: #38bdf8 !important;
  background: #181818 !important;
}
.sgp-select-dark {
  background: #121212 !important;
  border: 1px solid #444444 !important;
  color: #efefef !important;
  padding: 6px 10px !important;
  font-size: 12.5px !important;
  border-radius: 3px !important;
  outline: none !important;
  box-sizing: border-box;
}
.sgp-textarea-dark {
  background: #121212 !important;
  border: 1px solid #444444 !important;
  color: #efefef !important;
  padding: 8px 10px !important;
  font-size: 12.5px !important;
  border-radius: 3px !important;
  outline: none !important;
  resize: vertical;
  box-sizing: border-box;
}
.sgp-listbox-dark {
  background: #121212 !important;
  border: 1px solid #444444 !important;
  color: #efefef !important;
  padding: 4px !important;
  font-size: 11.5px !important;
  border-radius: 3px !important;
  width: 100%;
  max-width: 420px;
}
.sgp-help-text {
  color: #d97706;
  font-size: 11px;
  margin-top: 3px;
  display: block;
}
.sgp-form-actions {
  background: #262626;
  padding: 14px 20px;
  border-top: 1px solid #3a3a3a;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}



/* ==========================================================================
   PADRONIZAÇÃO VISUAL DE CABEÇALHOS & BOTÕES (ESTILO ATIMIDIA)
   ========================================================================== */
.page-header {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  margin-bottom: 24px !important;
  gap: 16px;
}
.page-header > div:first-child {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.page-header h2, .page-header h1 {
  margin: 0 !important;
  color: #f8fafc !important;
  font-size: 24px !important;
  font-weight: 800 !important;
  letter-spacing: -0.5px !important;
}
.page-header p {
  margin: 0 !important;
  color: #94a3b8 !important;
  font-size: 13px !important;
}
.page-header .header-actions {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
}
.card-header {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  padding: 16px 20px !important;
  border-bottom: 1px solid #1e293b !important;
  background: transparent !important;
}
.card-title {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  color: #f8fafc !important;
  font-size: 15px !important;
  font-weight: 700 !important;
}
.btn-secondary {
  background: #131722 !important;
  border: 1px solid #334155 !important;
  color: #cbd5e1 !important;
  border-radius: 8px !important;
  padding: 8px 16px !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  transition: all 0.2s ease !important;
}
.btn-secondary:hover {
  background: #1e293b !important;
  border-color: #38bdf8 !important;
  color: #fff !important;
}
.btn-primary {
  background: linear-gradient(135deg, #8b5cf6, #6d28d9) !important;
  border: 1px solid #a78bfa !important;
  color: #fff !important;
  border-radius: 8px !important;
  padding: 8px 16px !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  cursor: pointer !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  transition: all 0.2s ease !important;
  box-shadow: 0 4px 15px rgba(139, 92, 246, 0.25) !important;
}
.btn-primary:hover {
  filter: brightness(1.1) !important;
  transform: translateY(-1px) !important;
}



/* ==========================================================================
   MODAL POPUP DE REVISÃO OFICIAL SGP
   ========================================================================== */
.sgp-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  z-index: 999999;
  display: none;
  justify-content: center;
  align-items: center;
  padding: 20px;
}
.sgp-modal-container {
  background: #1e1e1e;
  border: 1px solid #3d3d3d;
  border-radius: 10px;
  width: min(1000px, 95vw);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.9), 0 0 35px rgba(56, 189, 248, 0.15);
  overflow: hidden;
}
.sgp-modal-body {
  overflow-y: auto;
  flex: 1;
  padding: 0;
}
.sgp-modal-footer {
  background: #252525;
  padding: 14px 24px;
  border-top: 1px solid #383838;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
}


/* ===== ESTILOS BLINDADOS DA ESTEIRA SGP (PF & PJ) ===== */
.pipeline-stage-card {
  background: rgba(15, 23, 42, 0.75) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 14px !important;
  padding: 24px !important;
  margin-bottom: 24px !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35) !important;
}

.dropzone-box-pro {
  background: rgba(15, 23, 42, 0.6) !important;
  border: 2px dashed rgba(56, 189, 248, 0.4) !important;
  border-radius: 12px !important;
  padding: 32px 20px !important;
  text-align: center !important;
  cursor: pointer !important;
  transition: all 0.25s ease !important;
}

.dropzone-box-pro:hover, .dropzone-box-pro.dragover {
  border-color: #38bdf8 !important;
  background: rgba(56, 189, 248, 0.08) !important;
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.2) !important;
}

.dropzone-icon-pro {
  font-size: 38px !important;
  margin-bottom: 8px !important;
}

.textarea-dark-pro {
  width: 100% !important;
  background: #090d16 !important;
  border: 1px solid #334155 !important;
  color: #f8fafc !important;
  border-radius: 8px !important;
  padding: 14px !important;
  font-family: inherit !important;
  font-size: 14px !important;
  line-height: 1.5 !important;
  box-sizing: border-box !important;
  outline: none !important;
  transition: border-color 0.2s, box-shadow 0.2s !important;
}

.textarea-dark-pro:focus {
  border-color: #8b5cf6 !important;
  box-shadow: 0 0 12px rgba(139, 92, 246, 0.3) !important;
}

.attached-chips-container {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 8px !important;
  margin-top: 14px !important;
  justify-content: center !important;
}

.attached-chip {
  background: #1e293b !important;
  border: 1px solid #38bdf8 !important;
  color: #e2e8f0 !important;
  border-radius: 20px !important;
  padding: 6px 14px !important;
  font-size: 12px !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
}

.attached-chip .chip-remove {
  cursor: pointer !important;
  color: #f43f5e !important;
  font-weight: bold !important;
}
