:root {
  --bg-primary: #0a0f1d;
  --bg-secondary: #0f172a;
  --bg-card: rgba(30, 41, 59, 0.7);
  --bg-card-solid: #1e293b;
  --bg-card-hover: rgba(51, 65, 85, 0.7);
  --border-color: rgba(148, 163, 184, 0.15);
  --border-active: rgba(99, 102, 241, 0.5);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --primary-glow: rgba(99, 102, 241, 0.35);
  --success: #10b981;
  --success-hover: #059669;
  --success-glow: rgba(16, 185, 129, 0.3);
  --danger: #f43f5e;
  --danger-hover: #e11d48;
  --warning: #f59e0b;
  --radius: 16px;
  --radius-sm: 10px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

body {
  background-color: var(--bg-primary);
  background-image: 
    radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.12) 0px, transparent 50%),
    radial-gradient(at 100% 0%, rgba(16, 185, 129, 0.08) 0px, transparent 50%),
    radial-gradient(at 50% 100%, rgba(14, 165, 233, 0.08) 0px, transparent 50%);
  background-attachment: fixed;
  color: var(--text-main);
  min-height: 100vh;
  padding: 24px;
}

.container {
  max-width: 1320px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Header */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  padding: 20px 32px;
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.brand {
  display: flex;
  align-items: center;
  gap: 18px;
}

.brand-icon {
  width: 52px;
  height: 52px;
  background: linear-gradient(135deg, #6366f1, #a855f7, #3b82f6);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: white;
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.4);
  position: relative;
  overflow: hidden;
}

.brand-icon::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(45deg, transparent, rgba(255,255,255,0.2), transparent);
  transform: rotate(45deg);
}

.brand h1 {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(to right, #ffffff, #cbd5e1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.header-status {
  display: flex;
  align-items: center;
  gap: 14px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 18px;
  border-radius: 30px;
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  backdrop-filter: blur(8px);
  border: 1px solid var(--border-color);
  transition: all 0.3s ease;
}

.status-badge.parado {
  background: rgba(244, 63, 94, 0.12);
  border-color: rgba(244, 63, 94, 0.3);
  color: #fda4af;
  box-shadow: 0 0 20px rgba(244, 63, 94, 0.15);
}

.status-badge.monitorando {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.35);
  color: #6ee7b7;
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.25);
}

.status-badge.imprimindo {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.35);
  color: #fde68a;
  box-shadow: 0 0 20px rgba(245, 158, 11, 0.25);
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: currentColor;
  box-shadow: 0 0 10px currentColor;
  animation: pulse 2s infinite ease-in-out;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.8); }
}

/* Metrics Grid */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.metric-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  padding: 22px 24px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  gap: 18px;
  transition: all 0.25s ease;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.metric-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-active);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}

.metric-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.metric-info h3 {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 4px;
  font-weight: 600;
}

.metric-info .value {
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: -0.5px;
}

/* Main Layout Grid */
.main-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 24px;
}

@media (max-width: 1080px) {
  .main-grid {
    grid-template-columns: 1fr;
  }
}

.card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
}

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

.card-title {
  font-size: 1.2rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 12px;
  letter-spacing: -0.3px;
}

/* STEP-BY-STEP PATH DESIGN (Passo 1, Passo 2, Passo 3, Passo 4) */
.steps-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: relative;
}

.step-card {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  transition: all 0.25s ease;
}

.step-card:hover {
  border-color: rgba(99, 102, 241, 0.4);
  background: rgba(15, 23, 42, 0.8);
}

.step-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.step-badge-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.step-number {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), #818cf8);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.85rem;
  box-shadow: 0 2px 8px var(--primary-glow);
}

.step-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #f1f5f9;
}

.step-actions {
  display: flex;
  gap: 10px;
}

/* Forms */
.input-wrapper {
  display: flex;
  gap: 8px;
}

input[type="text"],
select {
  width: 100%;
  background: #060a14;
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  outline: none;
  transition: all 0.2s ease;
}

input[type="text"]:focus,
select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
  background: #090e1c;
}

.helper-text {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 22px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.92rem;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
  user-select: none;
}

.btn-sm {
  padding: 7px 14px;
  font-size: 0.8rem;
  border-radius: 8px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), #4f46e5);
  color: #fff;
  box-shadow: 0 4px 14px var(--primary-glow);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.45);
}

.btn-success {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  box-shadow: 0 4px 14px var(--success-glow);
}
.btn-success:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.45);
}

.btn-danger {
  background: linear-gradient(135deg, #f43f5e, #e11d48);
  color: #fff;
  box-shadow: 0 4px 14px rgba(244, 63, 94, 0.3);
}
.btn-danger:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(244, 63, 94, 0.45);
}

.btn-secondary {
  background: #334155;
  color: #e2e8f0;
}
.btn-secondary:hover {
  background: #475569;
}

.btn-outline {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  color: #cbd5e1;
}
.btn-outline:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: #64748b;
  color: #fff;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

.actions-bar {
  display: flex;
  gap: 14px;
  margin-top: 6px;
}

.actions-bar .btn {
  flex: 1;
  padding: 14px 24px;
  font-size: 1rem;
}

/* History */
.history-container {
  max-height: 420px;
  overflow-y: auto;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: rgba(6, 10, 20, 0.7);
}

.history-list {
  display: flex;
  flex-direction: column;
}

.history-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  gap: 14px;
  transition: background 0.15s;
}

.history-item:hover {
  background: rgba(255, 255, 255, 0.04);
}

.history-item:last-child {
  border-bottom: none;
}

.history-file-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow: hidden;
}

.history-file-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: #f8fafc;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 320px;
}

.history-file-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
  display: flex;
  gap: 14px;
}

.history-actions {
  display: flex;
  gap: 8px;
}

/* Terminal Log */
.terminal-container {
  background: #050811;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  height: 400px;
  display: flex;
  flex-direction: column;
  font-family: 'Fira Code', Consolas, Monaco, monospace;
}

.terminal-header {
  background: #0b1120;
  padding: 10px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.terminal-body {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  font-size: 0.82rem;
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.log-line {
  display: flex;
  gap: 10px;
  word-break: break-word;
}

.log-time {
  color: #64748b;
  flex-shrink: 0;
}

.log-info { color: #94a3b8; }
.log-success { color: #34d399; font-weight: 600; }
.log-warning { color: #fbbf24; }
.log-error { color: #f87171; font-weight: 700; }
.log-print { color: #818cf8; font-weight: 600; }

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-box {
  background: #111827;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  width: 90%;
  max-width: 640px;
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
  max-height: 90vh;
  overflow-y: auto;
}

.folder-picker-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 320px;
  overflow-y: auto;
  background: #060a14;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 10px;
}

.folder-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: #0d1322;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.folder-item:hover {
  background: #1e293b;
  border-color: var(--primary);
}

.folder-item.selected {
  background: rgba(99, 102, 241, 0.2);
  border-color: var(--primary);
}

.folder-name-col {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 500;
  font-size: 0.92rem;
}

.breadcrumbs-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-muted);
  background: #060a14;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  overflow-x: auto;
}

.crumb-item {
  cursor: pointer;
  color: #818cf8;
  white-space: nowrap;
}

.crumb-item:hover {
  text-decoration: underline;
}

.empty-state {
  padding: 40px 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}
