/* FORM GROUPS */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

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

.form-row > * {
  flex: 1;
}

/* FILTERS & SEARCH */
.filters-bar {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

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

.search-box i, .search-box svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-tertiary);
  width: 16px;
  height: 16px;
}

.search-box input {
  padding-left: 36px;
}

.filter-select {
  width: auto;
  min-width: 150px;
}

/* O CONTEÚDO ORIGINAL AQUI FOI MOVIDO PARA O BLOCO FINAL RESPONSIVE */

/* LIST ITEMS & TABLES */
.card-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.list-item {
  background-color: var(--bg-primary);
  border: 0.5px solid var(--border);
  border-radius: 10px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: all var(--transition);
}

.list-item:hover {
  border-color: var(--border-hover);
  background-color: var(--bg-secondary);
}

.list-item-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: var(--blue-light);
  color: var(--blue);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
  flex-shrink: 0;
}

.list-item-info {
  flex: 1;
  min-width: 0;
}

.list-item-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  display: block;
}

.list-item-subtitle {
  font-size: 12px;
  color: var(--text-tertiary);
  display: block;
}

.list-item-meta {
  display: flex;
  gap: 24px;
  align-items: center;
  margin-right: 16px;
}

.meta-group {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.meta-label {
  font-size: 10px;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.meta-value {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}

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

/* MODAL FORM REFINEMENT */
.modal-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
  padding: 20px 24px;
  border-top: 1px solid var(--border);
  background: var(--bg-primary);
  border-radius: 0 0 16px 16px;
}
/* Removed redundant auth-box/body definitions to avoid conflicts with centralized system at line 485 */

.catalog-card {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  transition: var(--transition);
}

.catalog-card:hover {
  border-color: var(--blue);
}

.auth-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  background-color: var(--bg-secondary);
  padding: 4px;
  border-radius: 10px;
}

.auth-tab {
  flex: 1;
  padding: 8px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.auth-tab.active {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.auth-field {
  margin-bottom: 16px;
}

.auth-field label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.auth-link {
  background: none;
  border: none;
  color: var(--blue);
  font-size: 12px;
  cursor: pointer;
  padding: 0;
}

.auth-err, .auth-ok {
  padding: 10px;
  border-radius: 8px;
  font-size: 12px;
  margin-bottom: 16px;
  display: none;
}

.auth-err { background: rgba(220,53,69,0.1); color: #dc3545; }
.auth-ok { background: rgba(40,167,69,0.1); color: #28a745; }

/* TOASTS */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background-color: var(--text-primary);
  color: var(--bg-primary);
  padding: 12px 20px;
  border-radius: 12px;
  box-shadow: 0 8px 16px rgba(0,0,0,0.15);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 500;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  z-index: 2000;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

/* EQUIPAMENTO CARDS */
.equip-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.equip-card {
  background-color: var(--bg-primary);
  border: 0.5px solid var(--border);
  border-radius: 12px;
  transition: all var(--transition);
  display: flex;
  flex-direction: column;
}

.equip-card:hover {
  border-color: var(--blue);
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.equip-card-img {
  width: 100%;
  aspect-ratio: 4/3;
  background-color: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 12px 12px 0 0;
}

.equip-card-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.equip-card-content {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

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

.equip-card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.equip-card-id {
  font-size: 11px;
  color: var(--text-tertiary);
}

.equip-card-props {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.equip-prop {
  display: flex;
  flex-direction: column;
}

.equip-prop-label {
  font-size: 10px;
  color: var(--text-tertiary);
  text-transform: uppercase;
  margin-bottom: 2px;
}

.equip-prop-value {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
}

.equip-card-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  padding-top: 12px;
  border-top: 0.5px solid var(--border);
}

/* UTILS */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); }
.gap-20 { gap: 20px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.mt-24 { margin-top: 24px; }
.mr-8 { margin-right: 8px; }

.img-fit {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.bg-blue-light { background-color: rgba(26,111,212,0.1); }
.bg-orange-light { background-color: rgba(245,127,23,0.1); }
.bg-yellow-light { background-color: rgba(255,249,196,0.2); }
.bg-green-light { background-color: rgba(76,175,80,0.1); }
.bg-purple-light { background-color: rgba(124,77,255,0.1); }

.color-blue { color: var(--blue); }
.color-green { color: #2E7D32; }
.color-orange { color: #F57F17; }
.color-purple { color: #7c4dff; }

/* SIDEBAR FOOTER & PROFILE */
.sidebar-footer {
  padding: 12px 8px;
  margin-top: auto;
  border-top: 1px solid var(--border);
  background: var(--bg-primary);
  position: sticky;
  bottom: 0;
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.2s;
  overflow: hidden;
}

.user-profile:hover {
  background: var(--bg-secondary);
}

.user-avatar {
  width: 32px;
  height: 32px;
  background: var(--blue);
  color: white;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  flex-shrink: 0;
}

.user-info {
  display: flex;
  flex-direction: column;
  transition: opacity 0.2s;
}

.user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.user-plan {
  font-size: 11px;
  color: var(--text-tertiary);
}

.sidebar.collapsed .user-info {
  opacity: 0;
  pointer-events: none;
}

/* CATALOG CARDS */
.catalog-card {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  transition: all var(--transition);
  display: flex;
  flex-direction: column;
}

.catalog-card:hover {
  border-color: var(--blue);
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.catalog-header {
  height: 100px;
  background: linear-gradient(135deg, var(--blue-light), var(--bg-secondary));
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--blue);
}

.catalog-header i, .catalog-header svg {
  width: 40px;
  height: 40px;
}

.catalog-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.catalog-status {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-tertiary);
  letter-spacing: 0.05em;
}

.catalog-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  font-family: 'Outfit', sans-serif;
}

.catalog-sub {
  font-size: 12px;
  color: var(--text-secondary);
}

.catalog-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.cat-tag {
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
}

.cat-tag.purple { background: var(--purple-light); color: var(--purple); }
.cat-tag.green { background: var(--green-light); color: var(--green); }
.cat-tag.blue { background: var(--blue-light); color: var(--blue); }

.grid-4 {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}

/* STATS CARD SMALL */
.stat-card-small {
  background-color: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.01), 0 2px 4px -1px rgba(0, 0, 0, 0.01);
  transition: all var(--transition);
}

.stat-card-small:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.04), 0 4px 6px -2px rgba(0, 0, 0, 0.02);
  border-color: var(--border-hover);
}

.stat-card-small.bg-blue-light   { border-color: rgba(26, 115, 232, 0.40); }
.stat-card-small.bg-orange-light  { border-color: rgba(249, 115, 22, 0.40); }
.stat-card-small.bg-yellow-light  { border-color: rgba(245, 158, 11, 0.40); }
.stat-card-small.bg-green-light   { border-color: rgba(16, 185, 129, 0.40); }
.stat-card-small.bg-purple-light  { border-color: rgba(139, 92, 246, 0.40); }
.stat-card-small.bg-red-light     { background-color: rgba(239, 68, 68, 0.07); border-color: rgba(239, 68, 68, 0.40); }

.stat-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background-color: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all var(--transition);
}

.stat-icon i, .stat-icon svg {
  width: 20px !important;
  height: 20px !important;
  color: var(--text-secondary) !important;
}

.stat-card-small.bg-blue-light .stat-icon   { background-color: rgba(26, 115, 232, 0.15); }
.stat-card-small.bg-orange-light .stat-icon  { background-color: rgba(249, 115, 22, 0.15); }
.stat-card-small.bg-green-light .stat-icon   { background-color: rgba(16, 185, 129, 0.15); }
.stat-card-small.bg-purple-light .stat-icon  { background-color: rgba(139, 92, 246, 0.15); }
.stat-card-small.bg-yellow-light .stat-icon  { background-color: rgba(245, 158, 11, 0.15); }
.stat-card-small.bg-red-light .stat-icon     { background-color: rgba(239, 68, 68, 0.15); }

.stat-card-small.bg-blue-light .stat-icon i   { color: var(--blue) !important; }
.stat-card-small.bg-orange-light .stat-icon i  { color: var(--orange) !important; }
.stat-card-small.bg-green-light .stat-icon i   { color: var(--green) !important; }
.stat-card-small.bg-purple-light .stat-icon i  { color: var(--purple) !important; }
.stat-card-small.bg-yellow-light .stat-icon i  { color: var(--yellow) !important; }
.stat-card-small.bg-red-light .stat-icon i     { color: var(--red) !important; }

/* Stat value colored text per variant */
.stat-card-small.bg-green-light .stat-value   { color: var(--green); }
.stat-card-small.bg-blue-light .stat-value    { color: var(--blue); }
.stat-card-small.bg-orange-light .stat-value  { color: var(--orange); }
.stat-card-small.bg-purple-light .stat-value  { color: var(--purple); }
.stat-card-small.bg-yellow-light .stat-value  { color: var(--yellow); }
.stat-card-small.bg-red-light .stat-value     { color: var(--red); }

.stat-content {
  display: flex;
  flex-direction: row-reverse;
  justify-content: space-between;
  align-items: center;
  flex-grow: 1;
  gap: 12px;
}

.stat-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-secondary);
  letter-spacing: 0.05em;
}

.stat-value {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-primary);
  font-family: 'Outfit', sans-serif;
  white-space: nowrap;
}

/* PIPELINE PRODUCTION CARDS */
.pipeline-stage-card {
  flex: 1 1 calc(14% - 12px);
  min-width: 95px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: all var(--transition);
  opacity: 0.7;
}

.pipeline-stage-card.has-items {
  background: var(--bg-primary);
  border-color: var(--stage-color);
  opacity: 1;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}

.pipeline-stage-card.has-items:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.06);
}

.pipeline-stage-icon-wrapper {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.04);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
  color: var(--text-tertiary);
  transition: all var(--transition);
}

.dark .pipeline-stage-icon-wrapper {
  background: rgba(255, 255, 255, 0.06);
}

.pipeline-stage-card.has-items .pipeline-stage-icon-wrapper {
  color: var(--stage-color);
  background: var(--stage-light-color);
}

/* DROPDOWN MENUS (POP-UPS) */
.dropdown-container {
  position: relative;
  display: inline-block;
}

.dropdown-menu {
  display: none; /* Oculta o original estático dentro dos cards */
}

/* O clone injetado via portal global de dropdowns */
.global-dropdown-menu {
  display: block;
  background-color: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  animation: dropdownFadeIn 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  background: transparent;
  border: none;
  width: 100%;
  text-align: left;
}

.dropdown-item:hover {
  background-color: var(--bg-secondary);
  color: var(--text-primary);
}

.dropdown-item i, .dropdown-item svg {
  width: 16px;
  height: 16px;
  color: var(--text-tertiary);
  flex-shrink: 0;
  transition: color 0.15s ease;
}

.dropdown-item:hover i, .dropdown-item:hover svg {
  color: var(--blue);
}

@keyframes dropdownFadeIn {
  from {
    opacity: 0;
    transform: translateY(-4px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ============================================================
   CATALOG EDIT MODAL — Produto Search & Selected List
   ============================================================ */

/* Wrapper do campo de busca de produtos */
.prod-search-wrapper {
  position: relative;
}

/* Dropdown de resultados de busca */
.prod-search-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.18);
  z-index: 200;
  max-height: 240px;
  overflow-y: auto;
  padding: 6px;
  animation: dropdownFadeIn 0.15s cubic-bezier(0.16,1,0.3,1);
}

.prod-search-dropdown::-webkit-scrollbar { width: 4px; }
.prod-search-dropdown::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

/* Item individual no dropdown */
.prod-search-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.12s;
}

.prod-search-item:hover {
  background: var(--bg-secondary);
}

/* Thumbnail do item no dropdown — TAMANHO FIXO */
.prod-search-item img {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--border);
  background: var(--bg-secondary);
}

.prod-search-item .prod-item-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.prod-search-item .prod-item-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.prod-search-item .prod-item-price {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  margin-top: 2px;
}

/* Lista de produtos selecionados */
.prod-selected-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 10px;
  max-height: 220px;
  overflow-y: auto;
  padding-right: 2px;
}

.prod-selected-list::-webkit-scrollbar { width: 4px; }
.prod-selected-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

/* Card de produto selecionado */
.prod-selected-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 10px;
  transition: border-color 0.15s;
}

.prod-selected-item:hover {
  border-color: var(--blue);
}

/* Thumbnail do item selecionado — TAMANHO FIXO */
.prod-selected-item img {
  width: 36px;
  height: 36px;
  border-radius: 7px;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--border);
  background: var(--bg-primary);
}

.prod-selected-item .prod-sel-info {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.prod-selected-item .prod-sel-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.prod-selected-item .prod-sel-price {
  font-size: 0.72rem;
  color: var(--text-tertiary);
  margin-top: 1px;
}

.prod-sel-remove {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-tertiary);
  display: flex;
  align-items: center;
  padding: 4px;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
  flex-shrink: 0;
}

.prod-sel-remove:hover {
  color: var(--danger);
  background: rgba(220,53,69,0.08);
}

/* Seção de configurações no modal */
.cat-config-section {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.cat-config-section label.switch-label {
  flex: 1;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  user-select: none;
  margin: 0;
}

.cat-config-section .switch-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
}

.cat-config-section .switch-desc {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  margin-top: 2px;
}

/* Empty state dos produtos selecionados */
.prod-selected-empty {
  text-align: center;
  padding: 24px 12px;
  color: var(--text-tertiary);
  font-size: 0.82rem;
  border: 1px dashed var(--border);
  border-radius: 10px;
  margin-top: 10px;
}
