/* ==========================================================
   DESIGN SYSTEM - SISCOMEX HUB & N8N TESTER
   Modern Dark Glassmorphism Theme
   ========================================================== */

:root {
  --bg-main: #0b0f19;
  --bg-card: rgba(18, 24, 38, 0.75);
  --bg-card-hover: rgba(26, 35, 54, 0.85);
  --bg-sidebar: #0e1424;
  --border-color: rgba(255, 255, 255, 0.08);
  --border-focus: #3b82f6;

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --accent-blue: #3b82f6;
  --accent-cyan: #06b6d4;
  --accent-green: #10b981;
  --accent-purple: #8b5cf6;
  --accent-orange: #f59e0b;
  --accent-red: #ef4444;

  --gradient-primary: linear-gradient(135deg, #3b82f6 0%, #06b6d4 100%);
  --gradient-n8n: linear-gradient(135deg, #ec4899 0%, #8b5cf6 100%);
  --gradient-success: linear-gradient(135deg, #10b981 0%, #059669 100%);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.35);
  --shadow-glow: 0 0 25px rgba(59, 130, 246, 0.2);
}

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

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-main) !important;
  color: var(--text-primary) !important;
  min-height: 100vh;
  display: flex;
  overflow-x: hidden;
  background-image: 
    radial-gradient(at 0% 0%, rgba(59, 130, 246, 0.12) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(139, 92, 246, 0.1) 0px, transparent 50%);
}

/* Estrutura Principal */
.app-container {
  display: flex;
  width: 100vw;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: 280px;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  padding: 1.5rem 1.25rem;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 50;
}

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
}

.logo-icon {
  width: 44px;
  height: 44px;
  background: var(--gradient-primary);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  color: #fff;
  box-shadow: 0 0 15px rgba(59, 130, 246, 0.4);
}

.logo-text h2 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.2rem;
  font-weight: 700;
  color: #fff;
}

.logo-text h2 span {
  color: var(--accent-cyan);
}

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

/* Status do Certificado */
.cert-status-card {
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  margin-bottom: 1.5rem;
}

.cert-status-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-green);
  box-shadow: 0 0 8px var(--accent-green);
  animation: pulse 2s infinite;
}

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

.status-title {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--accent-green);
}

.cert-name {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 0.5rem;
}

.cert-meta {
  display: flex;
  align-items: center;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.55rem;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 600;
}

.badge-success {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-warning {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-purple {
  background: rgba(139, 92, 246, 0.15);
  color: #a78bfa;
  border: 1px solid rgba(139, 92, 246, 0.3);
}

.badge-blue {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

/* Navegação Sidebar */
.sidebar-nav {
  flex: 1;
}

.sidebar-nav ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.nav-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.75rem 1rem;
  background: transparent;
  border: none;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
}

.nav-btn i {
  font-size: 1.1rem;
  width: 20px;
  text-align: center;
}

.nav-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

.nav-btn.active {
  background: rgba(59, 130, 246, 0.12);
  color: var(--accent-cyan);
  border: 1px solid rgba(59, 130, 246, 0.3);
  box-shadow: 0 0 15px rgba(59, 130, 246, 0.15);
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
  font-size: 0.75rem;
  color: var(--text-muted);
}

.docs-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-secondary);
  text-decoration: none;
  margin-bottom: 0.5rem;
  transition: color 0.2s;
}

.docs-link:hover {
  color: var(--accent-cyan);
}

/* Conteúdo Principal */
.main-content {
  flex: 1;
  padding: 2rem 2.5rem;
  overflow-y: auto;
  max-width: calc(100vw - 280px);
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.topbar-title h1 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.65rem;
  font-weight: 700;
  color: #fff;
}

.topbar-title p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-top: 0.25rem;
}

.system-time {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Abas */
.tab-pane {
  display: none;
  animation: fadeIn 0.3s ease;
}

.tab-pane.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Cards Glassmorphism */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-md);
  margin-bottom: 1.5rem;
  transition: border-color 0.2s ease;
}

.glass-card:hover {
  border-color: rgba(255, 255, 255, 0.12);
}

/* Formulários */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
}

.form-grid-single {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-group label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.form-group input, 
.form-group select, 
.form-group textarea {
  background: rgba(11, 15, 25, 0.7);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  color: #fff;
  font-size: 0.9rem;
  outline: none;
  transition: all 0.2s ease;
  font-family: inherit;
}

.form-group textarea {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
}

.form-group input:focus, 
.form-group select:focus, 
.form-group textarea:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.3);
}

.input-with-button {
  display: flex;
  gap: 0.75rem;
}

.input-with-button input {
  flex: 1;
}

.form-options {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-color);
}

/* Custom Checkbox */
.checkbox-container {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
}

.checkbox-container input {
  display: none;
}

.checkmark {
  width: 18px;
  height: 18px;
  background: rgba(11, 15, 25, 0.8);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  position: relative;
  transition: all 0.2s ease;
}

.checkbox-container input:checked ~ .checkmark {
  background: var(--accent-blue);
  border-color: var(--accent-blue);
}

.checkbox-container input:checked ~ .checkmark:after {
  content: "";
  position: absolute;
  left: 6px;
  top: 2px;
  width: 4px;
  height: 9px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.form-actions {
  margin-top: 1.5rem;
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
}

/* Botões */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn-sm {
  padding: 0.45rem 0.85rem;
  font-size: 0.8rem;
}

.btn-primary {
  background: var(--gradient-primary);
  color: #fff;
  box-shadow: 0 0 15px rgba(59, 130, 246, 0.3);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 22px rgba(59, 130, 246, 0.5);
}

.btn-success {
  background: var(--gradient-success);
  color: #fff;
  box-shadow: 0 0 15px rgba(16, 185, 129, 0.3);
}

.btn-success:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 22px rgba(16, 185, 129, 0.5);
}

.btn-n8n {
  background: var(--gradient-n8n);
  color: #fff;
  box-shadow: 0 0 15px rgba(236, 72, 153, 0.3);
}

.btn-n8n:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 22px rgba(236, 72, 153, 0.5);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.07);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
}

/* Spinner / Loading */
.loading-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3.5rem 1rem;
  gap: 0.75rem;
}

.spinner {
  width: 48px;
  height: 48px;
  border: 3px solid rgba(59, 130, 246, 0.15);
  border-top-color: var(--accent-cyan);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-text {
  font-weight: 600;
  font-size: 1.05rem;
  color: #fff;
}

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

/* Estatísticas */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.stat-icon {
  width: 46px;
  height: 46px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

.icon-blue { background: rgba(59, 130, 246, 0.15); color: var(--accent-blue); }
.icon-green { background: rgba(16, 185, 129, 0.15); color: var(--accent-green); }
.icon-purple { background: rgba(139, 92, 246, 0.15); color: var(--accent-purple); }
.icon-orange { background: rgba(245, 158, 11, 0.15); color: var(--accent-orange); }

.stat-info {
  display: flex;
  flex-direction: column;
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

.stat-value {
  font-family: 'Outfit', sans-serif;
  font-size: 1.45rem;
  font-weight: 700;
  color: #fff;
}

.stat-value.small {
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 170px;
}

/* Tabelas */
.table-card {
  padding: 1.25rem;
}

.table-header-tools {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  gap: 1rem;
  flex-wrap: wrap;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: rgba(11, 15, 25, 0.7);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.85rem;
  flex: 1;
  max-width: 380px;
}

.search-box input {
  background: transparent;
  border: none;
  color: #fff;
  outline: none;
  font-size: 0.85rem;
  width: 100%;
}

.table-responsive {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.85rem;
}

.data-table th {
  background: rgba(11, 15, 25, 0.5);
  padding: 0.85rem 1rem;
  color: var(--text-secondary);
  font-weight: 600;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

.data-table td {
  padding: 0.9rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
  vertical-align: middle;
}

.data-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

.ce-link-btn {
  color: var(--accent-cyan);
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  background: none;
  border: none;
}

.ce-link-btn:hover {
  text-decoration: underline;
}

/* Banner de Rotinas & MSC */
.routine-banner, .n8n-banner, .msc-banner {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 1.25rem;
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: var(--radius-md);
  margin-bottom: 1.5rem;
}

.n8n-banner {
  background: rgba(236, 72, 153, 0.08);
  border-color: rgba(236, 72, 153, 0.2);
}

.msc-banner {
  background: rgba(245, 158, 11, 0.08);
  border-color: rgba(245, 158, 11, 0.2);
}

.routine-icon, .n8n-icon, .msc-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: var(--gradient-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  color: #fff;
  flex-shrink: 0;
}

.n8n-icon {
  background: var(--gradient-n8n);
}

.msc-icon {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.btn-msc {
  background: linear-gradient(135deg, #f59e0b 0%, #b45309 100%);
  color: #fff;
  box-shadow: 0 0 15px rgba(245, 158, 11, 0.3);
}

/* ==========================================================
   EXECUTIVE MSC TRACKING PRESENTATION STYLES
   ========================================================== */

/* Hero Banner Executivo */
.msc-hero-banner {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.12) 0%, rgba(30, 41, 59, 0.9) 100%);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  margin-bottom: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.5rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.msc-hero-left {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.msc-hero-icon {
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, #f59e0b 0%, #b45309 100%);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  color: #fff;
  box-shadow: 0 0 20px rgba(245, 158, 11, 0.4);
}

.msc-hero-title {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.msc-hero-title h2 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.6rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: 0.5px;
}

.msc-hero-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.badge-reefer {
  background: rgba(6, 182, 212, 0.2);
  color: #22d3ee;
  border: 1px solid rgba(6, 182, 212, 0.4);
  font-weight: 700;
  padding: 0.3rem 0.7rem;
  border-radius: 20px;
  font-size: 0.78rem;
}

.badge-eta-highlight {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.4);
  font-weight: 700;
  padding: 0.3rem 0.75rem;
  border-radius: 20px;
  font-size: 0.85rem;
}

/* Stepper de Rota Marítima */
.route-stepper-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  margin-bottom: 1.5rem;
}

.route-stepper-title {
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.route-stepper {
  display: flex;
  justify-content: space-between;
  position: relative;
  gap: 1rem;
  overflow-x: auto;
  padding: 1rem 0;
}

.route-stepper::before {
  content: "";
  position: absolute;
  top: 36px;
  left: 40px;
  right: 40px;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  z-index: 1;
}

.step-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  z-index: 2;
  flex: 1;
  min-width: 140px;
}

.step-icon {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: #1e293b;
  border: 3px solid rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  transition: all 0.3s ease;
}

.step-node.completed .step-icon {
  background: rgba(16, 185, 129, 0.2);
  border-color: var(--accent-green);
  color: var(--accent-green);
  box-shadow: 0 0 15px rgba(16, 185, 129, 0.4);
}

.step-node.current .step-icon {
  background: rgba(59, 130, 246, 0.25);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
  box-shadow: 0 0 20px rgba(6, 182, 212, 0.6);
  animation: pulseNode 2s infinite;
}

.step-node.planned .step-icon {
  background: rgba(245, 158, 11, 0.15);
  border-color: var(--accent-orange);
  color: var(--accent-orange);
}

@keyframes pulseNode {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

.step-info h5 {
  font-family: 'Outfit', sans-serif;
  font-size: 0.95rem;
  color: #fff;
  font-weight: 700;
}

.step-info p {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

.step-info .step-date {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  color: var(--accent-cyan);
  font-weight: 600;
  margin-top: 0.35rem;
  display: block;
}

/* Grade de Detalhes Executivos */
.executive-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.exec-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.35rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.exec-card-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.exec-card-header i {
  font-size: 1.1rem;
  color: var(--accent-cyan);
}

.exec-card-body h4 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.3rem;
  color: #fff;
  font-weight: 700;
}

.exec-card-body p {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.exec-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

/* Timeline Executiva Aprimorada */
.exec-timeline-item {
  position: relative;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1rem;
  transition: all 0.2s ease;
}

.exec-timeline-item:hover {
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateX(4px);
}

.exec-timeline-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.exec-timeline-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.exec-timeline-badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
}

.exec-timeline-location {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--accent-cyan);
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.exec-timeline-details {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
  padding-top: 0.75rem;
  margin-top: 0.75rem;
  border-top: 1px dashed var(--border-color);
  font-size: 0.8rem;
}

.exec-timeline-detail-item {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.exec-timeline-detail-label {
  color: var(--text-muted);
  font-size: 0.72rem;
}

.exec-timeline-detail-val {
  color: var(--text-primary);
  font-weight: 600;
}

.timeline-event-date {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-family: 'JetBrains Mono', monospace;
}

.timeline-event-location {
  font-size: 0.85rem;
  color: var(--accent-cyan);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.timeline-event-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
}

.routine-info h3, .n8n-info h3 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.15rem;
  color: #fff;
  margin-bottom: 0.25rem;
}

.routine-info p, .n8n-info p {
  color: var(--text-secondary);
  font-size: 0.85rem;
  line-height: 1.4;
}

/* Card de Status da Rotina Diária */
.routine-result-card {
  padding: 1.5rem;
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.routine-status-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.routine-status-icon {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.routine-status-icon.success { background: rgba(16, 185, 129, 0.15); color: var(--accent-green); }
.routine-status-icon.empty { background: rgba(59, 130, 246, 0.15); color: var(--accent-blue); }

.routine-status-text h3 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.25rem;
  color: #fff;
}

.routine-status-text p {
  color: var(--text-secondary);
  font-size: 0.85rem;
}

/* Detalhes de CE em Cards */
.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.25rem;
}

.detail-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
}

.detail-card-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.detail-card-title i {
  color: var(--accent-cyan);
}

.detail-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.detail-item {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  gap: 0.5rem;
}

.detail-item .label {
  color: var(--text-muted);
  font-weight: 500;
}

.detail-item .value {
  color: var(--text-primary);
  font-weight: 600;
  text-align: right;
  word-break: break-word;
}

/* Visualizador de JSON */
.json-viewer {
  background: #060911;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  color: #38bdf8;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.82rem;
  max-height: 400px;
  overflow-y: auto;
  line-height: 1.5;
}

.webhook-response-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

/* Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 2rem;
}

.modal-overlay.active {
  display: flex;
}

.modal-card {
  background: #0f1629;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 900px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
  animation: modalIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.96) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

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

.modal-title-group {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.modal-title-group i {
  font-size: 1.5rem;
  color: var(--accent-cyan);
}

.modal-title-group h3 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.25rem;
  color: #fff;
}

.modal-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.8rem;
  cursor: pointer;
  transition: color 0.2s;
  line-height: 1;
}

.modal-close-btn:hover {
  color: #fff;
}

.modal-body {
  padding: 1.75rem;
  overflow-y: auto;
  flex: 1;
}

/* Responsividade */
@media (max-width: 1024px) {
  .app-container {
    flex-direction: column;
  }
  .sidebar {
    width: 100%;
    height: auto;
    position: relative;
  }
  .main-content {
    max-width: 100%;
    padding: 1.5rem;
  }
}

/* ==========================================================
   OCR & DOCUMENT PARSER STYLES
   ========================================================== */

.ocr-banner {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 1.25rem 1.5rem;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.15) 0%, rgba(6, 182, 212, 0.12) 100%);
  border: 1px solid rgba(139, 92, 246, 0.3);
  border-radius: var(--radius-md);
  margin-bottom: 1.5rem;
}

.ocr-icon {
  width: 52px;
  height: 52px;
  min-width: 52px;
  background: linear-gradient(135deg, #8b5cf6 0%, #06b6d4 100%);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: #fff;
  box-shadow: 0 0 20px rgba(139, 92, 246, 0.4);
}

.ocr-info h3 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.15rem;
  color: #fff;
  margin-bottom: 0.25rem;
}

.ocr-info p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* Dropzone */
.dropzone-area {
  border: 2px dashed rgba(139, 92, 246, 0.4);
  background: rgba(18, 24, 38, 0.45);
  border-radius: var(--radius-lg);
  padding: 2.25rem 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
}

.dropzone-area:hover,
.dropzone-area.dragover {
  border-color: var(--accent-cyan);
  background: rgba(139, 92, 246, 0.08);
  box-shadow: 0 0 25px rgba(6, 182, 212, 0.2);
  transform: translateY(-2px);
}

.dropzone-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.dropzone-icon {
  width: 56px;
  height: 56px;
  background: rgba(139, 92, 246, 0.15);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  color: var(--accent-cyan);
  margin-bottom: 0.25rem;
}

.dropzone-content h4 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.05rem;
  color: var(--text-primary);
}

.dropzone-content p {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.file-limits {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* Dropzone Preview */
.dropzone-preview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(14, 20, 36, 0.8);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  text-align: left;
}

.file-preview-icon {
  font-size: 2rem;
  color: var(--accent-blue);
  margin-right: 1rem;
}

.file-preview-info {
  flex: 1;
}

.file-preview-info h4 {
  font-size: 0.95rem;
  color: #fff;
  font-family: 'Outfit', sans-serif;
  margin-bottom: 0.2rem;
  word-break: break-all;
}

.file-preview-info p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Status Bar do OCR */
.ocr-status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.5rem;
  padding: 1.5rem 1.75rem;
  background: linear-gradient(135deg, rgba(18, 24, 38, 0.9) 0%, rgba(30, 41, 67, 0.85) 100%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-lg);
}

.ocr-status-main {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.ocr-doc-badge .doc-badge-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-cyan);
  background: rgba(6, 182, 212, 0.12);
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-sm);
  display: inline-block;
  margin-bottom: 0.25rem;
}

.ocr-doc-badge h3 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.4rem;
  color: #fff;
}

.ocr-doc-meta-tags {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.meta-tag {
  font-size: 0.8rem;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.05);
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-sm);
}

.meta-tag strong {
  color: #fff;
}

/* Selos e Badges de Carimbo/Assinatura */
.ocr-stamps-group {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.stamp-pill {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.9rem;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
}

.stamp-pill.active-true {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.4);
  color: #34d399;
}

.stamp-pill.active-true i {
  color: #10b981;
}

.stamp-pill.active-false {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.3);
  color: #f87171;
}

.total-highlight {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.15) 0%, rgba(6, 182, 212, 0.15) 100%);
  border: 1px solid rgba(16, 185, 129, 0.4);
  padding: 0.6rem 1.25rem;
  border-radius: var(--radius-md);
}

.total-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.total-amount {
  font-family: 'Outfit', sans-serif;
  font-size: 1.4rem;
  font-weight: 700;
  color: #34d399;
}

/* Detail content grid for logistics */
.detail-content-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.75rem 1.5rem;
}

.highlight-badge {
  font-weight: 600;
  color: var(--accent-cyan);
  background: rgba(6, 182, 212, 0.1);
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-sm);
  display: inline-block;
}

.highlight-total {
  margin-top: 0.5rem;
  padding-top: 0.75rem;
  border-top: 1px dashed rgba(255, 255, 255, 0.15);
  font-weight: 700;
  color: #34d399 !important;
  font-size: 1.05rem;
}

.sub-table th, .sub-table td {
  padding: 0.5rem 0.75rem;
  font-size: 0.8rem;
}

.terms-text {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.6;
  white-space: pre-wrap;
  background: rgba(14, 20, 36, 0.6);
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  margin-top: 0.75rem;
}

.header-with-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.json-actions {
  display: flex;
  gap: 0.5rem;
}

/* ========================================================== */
/* FOLLOW-UP USA & E-MAILS (GOTENBERG + N8N)                  */
/* ========================================================== */
.followup-banner {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 1.25rem 1.5rem;
  background: linear-gradient(135deg, rgba(236, 72, 153, 0.12) 0%, rgba(99, 102, 241, 0.12) 100%);
  border: 1px solid rgba(236, 72, 153, 0.25);
  border-radius: var(--radius-lg);
  margin-bottom: 1.5rem;
}

.followup-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: linear-gradient(135deg, #ec4899 0%, #6366f1 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 4px 15px rgba(236, 72, 153, 0.3);
}

.followup-info h3 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.15rem;
  color: #fff;
  margin-bottom: 0.25rem;
}

.followup-info p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.config-sections-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
}

.config-box {
  background: rgba(14, 20, 36, 0.5);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.config-box h4 {
  font-size: 0.95rem;
  color: var(--accent-cyan);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.quick-templates {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
  padding-top: 0.75rem;
  border-top: 1px dashed var(--border-color);
}

.quick-title {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
}

.btn-xs {
  padding: 0.3rem 0.65rem;
  font-size: 0.75rem;
  border-radius: var(--radius-sm);
}

.custom-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  cursor: pointer;
  user-select: none;
  font-size: 0.85rem;
  color: var(--text-primary);
}

.custom-checkbox input {
  display: none;
}

.custom-checkbox .checkmark {
  width: 18px;
  height: 18px;
  border: 1.5px solid rgba(255, 255, 255, 0.3);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.05);
  display: inline-block;
  position: relative;
  transition: all 0.2s ease;
}

.custom-checkbox input:checked + .checkmark {
  background: var(--accent-cyan);
  border-color: var(--accent-cyan);
}

.custom-checkbox input:checked + .checkmark:after {
  content: "";
  position: absolute;
  left: 5px;
  top: 2px;
  width: 5px;
  height: 9px;
  border: solid #000;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.processos-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.processos-header h4 {
  font-size: 1.05rem;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.processos-header .subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.preview-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
}

.preview-tabs {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(14, 20, 36, 0.6);
  padding: 0.35rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.tab-pill {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.tab-pill:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

.tab-pill.active {
  background: rgba(59, 130, 246, 0.2);
  color: var(--accent-cyan);
  border: 1px solid rgba(59, 130, 246, 0.4);
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.2);
}

.preview-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.btn-glow {
  background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%) !important;
  box-shadow: 0 0 15px rgba(59, 130, 246, 0.4);
  font-weight: 600;
}

.btn-glow:hover {
  box-shadow: 0 0 20px rgba(59, 130, 246, 0.6);
  transform: translateY(-1px);
}

.email-preview-wrapper {
  background: #f8fafc;
  border-radius: var(--radius-md);
  padding: 2rem 1.5rem;
  border: 1px solid var(--border-color);
  min-height: 280px;
}

.report-preview-wrapper {
  background: #ffffff;
  border-radius: var(--radius-md);
  padding: 2rem 1.5rem;
  border: 1px solid var(--border-color);
  overflow-x: auto;
  min-height: 280px;
  color: #000;
}

.preview-pane {
  display: none;
  animation: fadeIn 0.25s ease;
}

.preview-pane.active {
  display: block;
}

