﻿* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

body {
  background-color: #f1f5f9;
  color: #1e293b;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* HEADER */
.top-header {
  background: #ffffff;
  border-bottom: 2px solid #e2e8f0;
  padding: 8px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 24px;
}

.logo-box {
  background: #0284c7;
  color: #ffffff;
  padding: 6px 14px;
  border-radius: 6px;
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: 0.5px;
}

.logo-text .highlight {
  color: #38bdf8;
}

.header-meta {
  display: flex;
  gap: 16px;
  font-size: 0.85rem;
  color: #64748b;
}

.header-meta strong {
  color: #0f172a;
}

.header-right {
  display: flex;
  gap: 10px;
}

.btn-head {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  color: #334155;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-head:hover {
  background: #e2e8f0;
  color: #0f172a;
}

#btnNovaIndustria {
  background: #0284c7;
  border-color: #0284c7;
  color: #ffffff;
}

#btnNovaIndustria:hover {
  background: #0369a1;
}

/* SEARCH SECTION */
.search-section {
  background: #ffffff;
  padding: 12px 20px;
  border-bottom: 1px solid #e2e8f0;
}

.search-bar-container {
  display: flex;
  border: 2px solid #0284c7;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(2, 132, 199, 0.08);
}

.search-label {
  background: #0284c7;
  color: #ffffff;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 10px 18px;
  display: flex;
  align-items: center;
}

.search-input-wrapper {
  display: flex;
  flex: 1;
  background: #ffffff;
  position: relative;
}

.search-input-wrapper input {
  flex: 1;
  border: none;
  outline: none;
  padding: 10px 16px;
  font-size: 0.95rem;
  color: #0f172a;
}

.search-input-wrapper button {
  background: transparent;
  border: none;
  color: #0284c7;
  font-size: 1.1rem;
  padding: 0 16px;
  cursor: pointer;
}

.quick-tags {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  font-size: 0.8rem;
  color: #64748b;
  flex-wrap: wrap;
}

.tag-btn {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  padding: 3px 10px;
  font-size: 0.78rem;
  color: #334155;
  cursor: pointer;
  transition: all 0.15s;
}

.tag-btn:hover {
  background: #e2e8f0;
  border-color: #94a3b8;
  color: #0284c7;
}

/* MAIN CONTENT */
.main-container {
  flex: 1;
  padding: 14px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow-y: auto;
}

.card {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  display: flex;
  flex-direction: column;
}

/* TOP ROW */
.top-row {
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: 14px;
  min-height: 380px;
}

/* PRODUCTS TABLE */
.products-panel {
  display: flex;
  flex-direction: column;
}

.table-header-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  font-size: 0.85rem;
  font-weight: 600;
  color: #475569;
}

.tip-identificador {
  color: #0284c7;
  font-size: 0.8rem;
}

.table-responsive {
  flex: 1;
  overflow-y: auto;
  max-height: 320px;
}

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

.grid-table th {
  background: #f8fafc;
  color: #334155;
  padding: 8px 12px;
  font-weight: 600;
  border-bottom: 2px solid #cbd5e1;
  position: sticky;
  top: 0;
  z-index: 2;
}

.grid-table td {
  padding: 8px 12px;
  border-bottom: 1px solid #f1f5f9;
  color: #1e293b;
}

.grid-table tbody tr {
  cursor: pointer;
  transition: background 0.15s;
}

.grid-table tbody tr:hover {
  background: #f0f9ff;
}

.grid-table tbody tr.selected {
  background: #e0f2fe;
  font-weight: 600;
}

.grid-table tbody tr.selected td:first-child {
  color: #0284c7;
}

.badge-comp {
  color: #0284c7;
  font-size: 1rem;
}

.panel-footer {
  padding: 8px 14px;
  border-top: 1px solid #e2e8f0;
  display: flex;
  justify-content: flex-start;
  background: #f8fafc;
}

.btn-report {
  background: none;
  border: 1px solid #f87171;
  color: #dc2626;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 0.78rem;
  cursor: pointer;
}

/* DETAILS PANEL (RIGHT) */
.details-panel {
  padding: 12px;
  overflow-y: auto;
}

.card-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 10px;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 6px;
}

.photo-viewer-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.photo-main-box {
  width: 100%;
  height: 180px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.photo-main-box img {
  max-width: 95%;
  max-height: 95%;
  object-fit: contain;
  transition: transform 0.3s ease;
}

.photo-main-box img:hover {
  transform: scale(1.15);
}

.photo-pagination {
  display: flex;
  gap: 6px;
}

.photo-page-btn {
  background: #0284c7;
  color: #ffffff;
  border: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.photo-page-btn.active {
  background: #0369a1;
  box-shadow: 0 0 0 2px #38bdf8;
}

.photo-actions {
  display: flex;
  gap: 10px;
  width: 100%;
}

.btn-action {
  flex: 1;
  padding: 6px 12px;
  border-radius: 20px;
  border: 1px solid #0284c7;
  color: #0284c7;
  background: #ffffff;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-decoration: none;
  transition: all 0.2s;
}

.btn-action:hover {
  background: #f0f9ff;
}

.btn-action.btn-blue {
  background: #0284c7;
  color: #ffffff;
}

.btn-action.btn-blue:hover {
  background: #0369a1;
}

.specs-container {
  margin-top: 14px;
}

.specs-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: #0284c7;
  margin-bottom: 8px;
}

.specs-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.82rem;
}

.spec-item {
  display: flex;
  justify-content: space-between;
  padding: 4px 6px;
  background: #f8fafc;
  border-radius: 4px;
}

.spec-label {
  color: #0284c7;
  font-weight: 600;
}

.spec-val {
  color: #334155;
  font-weight: 500;
}

/* BOTTOM ROW */
.bottom-row {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 14px;
  min-height: 240px;
}

.card-title-bar {
  background: #0284c7;
  color: #ffffff;
  padding: 8px 14px;
  font-size: 0.85rem;
  font-weight: 700;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.badge-group {
  background: rgba(255, 255, 255, 0.2);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 500;
}

.btn-small-add {
  background: #ffffff;
  color: #0284c7;
  border: none;
  width: 22px;
  height: 22px;
  border-radius: 4px;
  font-size: 0.8rem;
  cursor: pointer;
}

/* CONVERSIONS */
.conversions-content {
  padding: 10px 14px;
  overflow-y: auto;
  max-height: 240px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.conv-group {
  border-bottom: 1px solid #f1f5f9;
  padding-bottom: 6px;
}

.conv-industry {
  font-size: 0.82rem;
  font-weight: 700;
  color: #0284c7;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.conv-codes {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding-left: 10px;
}

.conv-code-item {
  font-size: 0.85rem;
  font-family: monospace;
  color: #1e293b;
  display: flex;
  justify-content: space-between;
}

.conv-badge {
  font-size: 0.7rem;
  padding: 1px 6px;
  border-radius: 4px;
  background: #e2e8f0;
  color: #475569;
}

.conv-badge.principal {
  background: #dbeafe;
  color: #1e40af;
  font-weight: 700;
}

/* APPLICATIONS TABLE */
.applications-panel {
  display: flex;
  flex-direction: column;
}

/* MODAL */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
}

.modal-box {
  background: #ffffff;
  width: 550px;
  max-width: 95vw;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 20px 25px -5px rgba(0,0,0,0.2);
}

.modal-header {
  background: #0284c7;
  color: #ffffff;
  padding: 12px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  font-size: 1.05rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-close-modal {
  background: none;
  border: none;
  color: #ffffff;
  font-size: 1.5rem;
  cursor: pointer;
}

.modal-body {
  padding: 18px 20px;
}

.modal-desc {
  font-size: 0.85rem;
  color: #475569;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  padding: 10px;
  border-radius: 6px;
  margin-bottom: 14px;
  line-height: 1.4;
}

.form-group {
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.form-group label {
  font-size: 0.82rem;
  font-weight: 600;
  color: #334155;
}

.form-group input, .form-group select {
  padding: 8px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  font-size: 0.85rem;
  outline: none;
}

.form-group input:focus, .form-group select:focus {
  border-color: #0284c7;
  box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.2);
}

.form-group small {
  font-size: 0.72rem;
  color: #64748b;
}

.form-row {
  display: flex;
  gap: 12px;
}

.form-row .col {
  flex: 1;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid #e2e8f0;
}

.btn-secondary {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #475569;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.85rem;
}

.btn-primary {
  background: #0284c7;
  border: 1px solid #0284c7;
  color: #ffffff;
  padding: 8px 18px;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-primary:hover {
  background: #0369a1;
}