/* Reset e Base */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  color: #f1f5f9;
  line-height: 1.6;
  min-height: 100vh;
}

/* Header */
.header {
  background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
  border-bottom: 1px solid #334155;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.header-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo svg {
  color: #3b82f6;
}

.logo h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #f1f5f9;
}

.header-subtitle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: #94a3b8;
}

.badge {
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  color: white;
  padding: 0.25rem 0.5rem;
  border-radius: 0.375rem;
  font-size: 0.75rem;
  font-weight: 500;
}

.separator {
  color: #64748b;
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: rgba(15, 23, 42, 0.5);
  border-radius: 0.5rem;
  border: 1px solid #334155;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Main */
.main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

/* Status Cards */
.status-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.status-card {
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid #334155;
  border-radius: 0.75rem;
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: all 0.2s ease;
}

.status-card:hover {
  background: rgba(30, 41, 59, 0.8);
  transform: translateY(-2px);
}

.status-card-icon {
  font-size: 1.5rem;
}

.status-card-content {
  flex: 1;
}

.status-card-label {
  font-size: 0.875rem;
  color: #94a3b8;
  margin-bottom: 0.25rem;
}

.status-card-value {
  font-weight: 600;
  color: #f1f5f9;
}

/* Navigation Tabs */
.nav-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 2rem;
  background: rgba(15, 23, 42, 0.5);
  padding: 0.5rem;
  border-radius: 0.75rem;
  border: 1px solid #334155;
}

.nav-tab {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: transparent;
  border: none;
  border-radius: 0.5rem;
  color: #94a3b8;
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 500;
}

.nav-tab:hover {
  background: rgba(59, 130, 246, 0.1);
  color: #3b82f6;
}

.nav-tab.active {
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  color: white;
}

.nav-tab svg {
  width: 20px;
  height: 20px;
}

/* Tab Content */
.tab-content {
  display: none;
}

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

.content-header {
  margin-bottom: 2rem;
}

.content-header h2 {
  font-size: 1.875rem;
  font-weight: 700;
  color: #f1f5f9;
  margin-bottom: 0.5rem;
}

.content-header p {
  color: #94a3b8;
  font-size: 1rem;
}

/* Input Grid */
.input-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

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

.input-card {
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid #334155;
  border-radius: 0.75rem;
  overflow: hidden;
}

.input-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  background: rgba(15, 23, 42, 0.5);
  border-bottom: 1px solid #334155;
}

.input-card-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  color: #f1f5f9;
}

.input-card-title svg {
  color: #3b82f6;
}

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

.btn-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid #3b82f6;
  border-radius: 0.375rem;
  color: #3b82f6;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-icon:hover {
  background: #3b82f6;
  color: white;
}

.btn-icon.secondary {
  background: rgba(239, 68, 68, 0.1);
  border-color: #ef4444;
  color: #ef4444;
}

.btn-icon.secondary:hover {
  background: #ef4444;
  color: white;
}

.json-input {
  width: 100%;
  padding: 1.5rem;
  background: rgba(15, 23, 42, 0.8);
  border: none;
  color: #f1f5f9;
  font-family: 'JetBrains Mono', 'Fira Code', Consolas, monospace;
  font-size: 0.875rem;
  line-height: 1.5;
  resize: vertical;
  outline: none;
}

.json-input::placeholder {
  color: #64748b;
}

/* Controls */
.controls-section {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  padding: 1.5rem;
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid #334155;
  border-radius: 0.75rem;
}

@media (max-width: 768px) {
  .controls-section {
    flex-direction: column;
    gap: 1rem;
    align-items: stretch;
  }
}

.control-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.control-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #94a3b8;
}

.control-label svg {
  color: #3b82f6;
}

.select-input {
  padding: 0.5rem 1rem;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid #334155;
  border-radius: 0.5rem;
  color: #f1f5f9;
  font-size: 0.875rem;
  outline: none;
  cursor: pointer;
}

.select-input:focus {
  border-color: #3b82f6;
}

.action-buttons {
  display: flex;
  gap: 1rem;
}

@media (max-width: 768px) {
  .action-buttons {
    width: 100%;
    justify-content: stretch;
  }
  
  .action-buttons .btn {
    flex: 1;
  }
}

.btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 0.5rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn.primary {
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  color: white;
}

.btn.primary:hover {
  background: linear-gradient(135deg, #2563eb, #1e40af);
  transform: translateY(-1px);
}

.btn.secondary {
  background: rgba(71, 85, 105, 0.5);
  color: #94a3b8;
  border: 1px solid #475569;
}

.btn.secondary:hover {
  background: rgba(71, 85, 105, 0.8);
  color: #f1f5f9;
}

/* Output */
.output-section {
  margin-bottom: 2rem;
}

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

.output-header h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: #f1f5f9;
}

.loading-indicator {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #3b82f6;
  font-size: 0.875rem;
}

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid #334155;
  border-top: 2px solid #3b82f6;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.output-display {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid #334155;
  border-radius: 0.75rem;
  padding: 1.5rem;
  font-family: 'JetBrains Mono', 'Fira Code', Consolas, monospace;
  font-size: 0.875rem;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-x: auto;
  max-height: 500px;
  overflow-y: auto;
  color: #e2e8f0;
}

.output-display:empty::before {
  content: "Nenhum resultado ainda...";
  color: #64748b;
  font-style: italic;
}

/* Chat */
.chat-container {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.chat-input-section {
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid #334155;
  border-radius: 0.75rem;
  padding: 1.5rem;
}

.chat-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

@media (max-width: 768px) {
  .chat-controls {
    flex-direction: column;
    gap: 1rem;
    align-items: stretch;
  }
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 0.875rem;
  color: #94a3b8;
}

.checkbox-label input[type="checkbox"] {
  display: none;
}

.checkmark {
  width: 18px;
  height: 18px;
  border: 2px solid #334155;
  border-radius: 0.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark {
  background: #3b82f6;
  border-color: #3b82f6;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark::after {
  content: "✓";
  color: white;
  font-size: 12px;
}

.chat-input-container {
  display: flex;
  gap: 1rem;
  align-items: flex-end;
}

@media (max-width: 768px) {
  .chat-input-container {
    flex-direction: column;
    align-items: stretch;
  }
}

.chat-input {
  flex: 1;
  padding: 1rem;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid #334155;
  border-radius: 0.5rem;
  color: #f1f5f9;
  font-family: inherit;
  font-size: 0.875rem;
  line-height: 1.5;
  resize: vertical;
  outline: none;
}

.chat-input:focus {
  border-color: #3b82f6;
}

.chat-input::placeholder {
  color: #64748b;
}

.chat-send-btn {
  align-self: flex-end;
}

@media (max-width: 768px) {
  .chat-send-btn {
    align-self: stretch;
  }
}

.chat-output-section {
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid #334155;
  border-radius: 0.75rem;
  color: #f1f5f9;
}

.chat-output {
  min-height: 200px;
}

/* Admin Técnicos */
.admin-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 1.5rem;
}

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

.admin-card {
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid #334155;
  border-radius: 0.75rem;
  padding: 1rem;
}

.table {
  display: grid;
  gap: 8px;
}

.table .row {
  display: grid;
  grid-template-columns: 1fr 120px 1fr 120px 120px;
  gap: 8px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid #334155;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.6);
}

.table .head { font-weight: 600; background: rgba(59, 130, 246, 0.08); }
.table .cell { color: #e2e8f0; font-size: 0.9rem; }

.form-grid { display: flex; flex-direction: column; gap: 12px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-col { display: flex; flex-direction: column; gap: 6px; }

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

.inline-inputs { display: flex; align-items: center; gap: 8px; }

.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  padding: 6px 10px;
  border: 1px solid #334155;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.8);
  color: #cbd5e1;
  cursor: pointer;
  font-size: 12px;
}
.chip.selected { border-color: #3b82f6; background: rgba(59, 130, 246, 0.12); color: #e2e8f0; }

.capacidade-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.capacidade-item { display: flex; flex-direction: column; gap: 4px; }
.capacidade-item input { width: 100%; }

/* Footer */
.footer {
  margin-top: 4rem;
  border-top: 1px solid #334155;
  background: rgba(15, 23, 42, 0.5);
}
.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.875rem;
  color: #64748b;
}

@media (max-width: 768px) {
  .footer-content {
    flex-direction: column;
    gap: 0.5rem;
    text-align: center;
  }
}

.footer-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.version {
  background: rgba(59, 130, 246, 0.1);
  color: #3b82f6;
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.75rem;
  font-weight: 500;
}

/* Responsive */
@media (max-width: 768px) {
  .header-content {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
  
  .header-left {
    flex-direction: column;
    gap: 1rem;
  }
  
  .main {
    padding: 1rem;
  }
  
  .status-cards {
    grid-template-columns: 1fr;
  }
  
  .nav-tabs {
    flex-direction: column;
  }
  
  .nav-tab {
    justify-content: center;
  }
}

/* Form Views */
.form-view {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.form-section {
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid #334155;
  border-radius: 0.75rem;
  padding: 1.5rem;
}

.list-section {
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid #334155;
  border-radius: 0.75rem;
  padding: 1.5rem;
}

.list-section h4 {
  margin-bottom: 1rem;
  color: #e2e8f0;
  font-weight: 600;
}

.items-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-height: 300px;
  overflow-y: auto;
}

.item-card {
  background: rgba(51, 65, 85, 0.3);
  border: 1px solid #475569;
  border-radius: 0.5rem;
  padding: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  transition: all 0.2s ease;
}

.item-card:hover {
  background: rgba(51, 65, 85, 0.5);
  border-color: #64748b;
}

.item-info {
  flex: 1;
}

.item-title {
  font-weight: 600;
  color: #f1f5f9;
  margin-bottom: 0.25rem;
}

.item-details {
  font-size: 0.875rem;
  color: #94a3b8;
  line-height: 1.4;
}

.item-actions {
  display: flex;
  gap: 0.5rem;
  margin-left: 1rem;
}

.item-actions .btn {
  padding: 0.375rem 0.75rem;
  font-size: 0.75rem;
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 2rem;
  color: #64748b;
  font-style: italic;
}

/* Form validation */
.form-error {
  border-color: #ef4444 !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1) !important;
}

.error-message {
  color: #ef4444;
  font-size: 0.75rem;
  margin-top: 0.25rem;
}
