/* Dashboard styles */
.dashboard-wrapper {
  display: flex;
  width: 100%;
  height: 100vh;
  overflow: hidden;
}

.dashboard-container {
  margin-left: 220px;
  width: calc(100% - 220px);
  height: 100vh;
  overflow: hidden;
  padding: 0;
  position: relative;
}

/* Global Loading Overlay */
.dashboard-global-loading {
  position: fixed;
  top: 0;
  left: 220px;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  backdrop-filter: blur(3px);
}

.global-loading-content {
  text-align: center;
  animation: fadeIn 0.3s ease-in;
}

.global-loading-spinner {
  margin-bottom: 20px;
}

.global-loading-spinner i {
  font-size: 64px;
  color: #3b82f6;
  animation: spin 1s linear infinite;
}

.global-loading-text {
  font-size: 18px;
  font-weight: 500;
  color: #374151;
  margin: 0;
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.6;
  }
}

.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  width: 220px;
  background-color: #f8f9fa;
  border-right: 1px solid #e9ecef;
  padding: 20px 0 0 0;
  height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  z-index: 100;
}

.dashboard-content {
  flex: 1;
  padding: 20px 20px 20px 10px;
  overflow-y: auto;
  height: 100vh;
  background-color: #f5f7fa;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  width: 100%;
}

.dashboard-card {
  background-color: #ffffff;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 250px;
  transition: transform 0.2s, box-shadow 0.2s;
}

.dashboard-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.card-title {
  display: flex;
  align-items: center;
  padding: 15px;
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: #333;
  background-color: #fbfbfb;
  border-bottom: 1px solid #f0f0f0;
}

.icon {
  margin-right: 8px;
  font-size: 18px;
}

/* URL Card */
.url-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.iframe-container {
  flex: 1;
  overflow: hidden;
  position: relative;
}

.website-frame {
  width: 100%;
  height: 100%;
  border: none;
  min-height: 400px;
}

/* AI Response Cards */
.ai-response-card {
  position: relative;
}

.ai-response-content {
  flex: 1;
  padding: 15px;
  overflow-y: auto;
  max-height: 300px;
  font-size: 14px;
  line-height: 1.5;
}

.loading-placeholder {
  color: #888;
  font-style: italic;
  padding: 20px 0;
  text-align: center;
}

.card-footer {
  border-top: 1px solid #f0f0f0;
  padding: 10px 15px;
  display: flex;
  justify-content: flex-end;
}

.refresh-button {
  background-color: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 4px;
  padding: 6px 12px;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  transition: background-color 0.2s;
}

.refresh-button:hover {
  background-color: #e9ecef;
}

.refresh-icon {
  margin-right: 5px;
  font-size: 14px;
}

/* Loading indicator */
.loading-indicator {
  display: flex;
  align-items: center;
  margin-left: auto;
}

.loading-indicator.hidden {
  display: none;
}

.spinner {
  border: 2px solid #f3f3f3;
  border-top: 2px solid #3498db;
  border-radius: 50%;
  width: 16px;
  height: 16px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Submenu */
.submenu {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 0 15px 15px 15px;
  flex-shrink: 0;
}

.submenu-item {
  padding: 10px 15px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  transition: background-color 0.2s;
}

.submenu-item:hover {
  background-color: #e9ecef;
}

.submenu-item.active {
  background-color: #007bff;
  color: white;
}

/* Markdown styling */
.ai-response-content h1 {
  font-size: 1.5em;
  margin-top: 0.5em;
  margin-bottom: 0.5em;
}

.ai-response-content h2 {
  font-size: 1.3em;
  margin-top: 0.5em;
  margin-bottom: 0.5em;
}

.ai-response-content h3 {
  font-size: 1.1em;
  margin-top: 0.5em;
  margin-bottom: 0.5em;
}

.ai-response-content strong {
  font-weight: 600;
}

.ai-response-content em {
  font-style: italic;
}

.ai-response-content ul {
  margin: 0.5em 0;
  padding-left: 1.5em;
}

.ai-response-content li {
  margin-bottom: 0.25em;
}

/* Panel Chat Styles */
.panel-chat-container {
  border-top: 1px solid #f0f0f0;
  background-color: #fafafa;
}

.panel-chat-toggle {
  display: flex;
  align-items: center;
  padding: 10px 15px;
  cursor: pointer;
  background-color: #f8f9fa;
  transition: background-color 0.2s;
  gap: 8px;
}

.panel-chat-toggle:hover {
  background-color: #e9ecef;
}

.chat-icon {
  font-size: 16px;
}

.chat-toggle-text {
  flex: 1;
  font-size: 13px;
  font-weight: 500;
  color: #555;
}

.chat-toggle-arrow {
  font-size: 12px;
  color: #888;
  transition: transform 0.2s;
}

.panel-chat-content {
  display: flex;
  flex-direction: column;
  max-height: 300px;
  background-color: #ffffff;
}

.panel-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 15px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 150px;
  max-height: 250px;
}

.panel-chat-welcome {
  padding: 12px;
  background-color: #f0f7ff;
  border: 1px solid #d0e7ff;
  border-radius: 6px;
  font-size: 13px;
  color: #0066cc;
  line-height: 1.5;
}

.panel-chat-welcome strong {
  display: block;
  margin-top: 4px;
  color: #004999;
}

.panel-chat-message {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-width: 85%;
}

.panel-chat-message.user {
  align-self: flex-end;
}

.panel-chat-message.ai {
  align-self: flex-start;
}

.panel-chat-message-content {
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.5;
  word-wrap: break-word;
}

.panel-chat-message.user .panel-chat-message-content {
  background-color: #007bff;
  color: white;
  border-bottom-right-radius: 2px;
}

.panel-chat-message.ai .panel-chat-message-content {
  background-color: #f1f3f5;
  color: #333;
  border-bottom-left-radius: 2px;
}

.panel-chat-timestamp {
  font-size: 11px;
  color: #999;
  padding: 0 4px;
}

.panel-chat-message.user .panel-chat-timestamp {
  text-align: right;
}

.panel-chat-message.ai .panel-chat-timestamp {
  text-align: left;
}

.panel-chat-typing {
  display: flex;
  gap: 4px;
  padding: 10px 12px;
  background-color: #f1f3f5;
  border-radius: 8px;
  width: fit-content;
  border-bottom-left-radius: 2px;
}

.typing-dot {
  width: 8px;
  height: 8px;
  background-color: #888;
  border-radius: 50%;
  animation: typing 1.4s infinite;
}

.typing-dot:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typing {
  0%, 60%, 100% {
    opacity: 0.3;
    transform: translateY(0);
  }
  30% {
    opacity: 1;
    transform: translateY(-4px);
  }
}

.panel-chat-input-container {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid #e9ecef;
  background-color: #ffffff;
}

.panel-chat-input {
  flex: 1;
  border: 1px solid #d0d7de;
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 13px;
  font-family: inherit;
  resize: none;
  min-height: 36px;
  max-height: 100px;
  overflow-y: auto;
  line-height: 1.4;
}

.panel-chat-input:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.panel-chat-send {
  background-color: #007bff;
  color: white;
  border: none;
  border-radius: 6px;
  padding: 8px 12px;
  cursor: pointer;
  transition: background-color 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
}

.panel-chat-send:hover {
  background-color: #0056b3;
}

.panel-chat-send:active {
  background-color: #004085;
}

.panel-chat-send:disabled {
  background-color: #6c757d;
  cursor: not-allowed;
}

/* Markdown styling in panel chat messages */
.panel-chat-message-content h1,
.panel-chat-message-content h2,
.panel-chat-message-content h3 {
  font-size: 1em;
  font-weight: 600;
  margin: 0.5em 0 0.25em 0;
}

.panel-chat-message-content p {
  margin: 0.5em 0;
}

.panel-chat-message-content ul,
.panel-chat-message-content ol {
  margin: 0.5em 0;
  padding-left: 1.5em;
}

.panel-chat-message-content li {
  margin-bottom: 0.25em;
}

.panel-chat-message-content code {
  background-color: rgba(0, 0, 0, 0.05);
  padding: 2px 4px;
  border-radius: 3px;
  font-size: 0.9em;
}

.panel-chat-message.user .panel-chat-message-content code {
  background-color: rgba(255, 255, 255, 0.2);
}

.panel-chat-message-content pre {
  background-color: rgba(0, 0, 0, 0.05);
  padding: 8px;
  border-radius: 4px;
  overflow-x: auto;
  margin: 0.5em 0;
}

/* Responsive adjustments */
@media (max-width: 1440px) {
  .dashboard-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 1024px) {
  .dashboard-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .dashboard-container {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    height: auto;
    border-right: none;
    border-bottom: 1px solid #e9ecef;
    padding: 10px 0;
  }

  .submenu {
    flex-direction: row;
    overflow-x: auto;
    gap: 10px;
    padding: 10px 15px;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .panel-chat-message {
    max-width: 90%;
  }
}

/* Sidebar Footer for Admin Config Button */
.sidebar-footer {
  margin-top: 20px;
  padding: 15px;
  border-top: 1px solid #e9ecef;
  display: flex !important;
  flex-direction: column !important;
  gap: 10px !important;
  flex-shrink: 0;
  background-color: #f8f9fa;
}

.admin-config-btn {
  display: flex !important;
  align-items: center;
  gap: 10px;
  padding: 12px 15px;
  color: white;
  text-decoration: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
  border: none;
  cursor: pointer;
  width: 100%;
}

.admin-config-btn:hover {
  transform: translateY(-2px);
}

.admin-config-btn i {
  font-size: 16px;
}

/* Botão Adicionar Painel - Verde */
.btn-add-panel {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
  box-shadow: 0 2px 4px rgba(16, 185, 129, 0.2);
  visibility: visible !important;
  opacity: 1 !important;
  position: relative !important;
  margin-bottom: 10px !important;
}

.btn-add-panel:hover {
  box-shadow: 0 4px 8px rgba(16, 185, 129, 0.3);
}

/* Botão Gerenciar Painéis - Laranja */
.btn-manage-panels {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
  box-shadow: 0 2px 4px rgba(245, 158, 11, 0.2);
  visibility: visible !important;
  opacity: 1 !important;
  position: relative !important;
  margin-bottom: 10px !important;
}

.btn-manage-panels:hover {
  box-shadow: 0 4px 8px rgba(245, 158, 11, 0.3);
}

/* Botão Configurar Dashboard - Azul */
.btn-config-dashboard {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%) !important;
  box-shadow: 0 2px 4px rgba(59, 130, 246, 0.2);
  visibility: visible !important;
  opacity: 1 !important;
  position: relative !important;
}

.btn-config-dashboard:hover {
  box-shadow: 0 4px 8px rgba(59, 130, 246, 0.3);
}

/* ========================================
   NOVO SISTEMA DE DASHBOARD DINÂMICO
   ======================================== */

/* Grid Flexível com Column Span */
.dashboard-grid {
  display: grid;
  gap: 20px;
  grid-auto-flow: dense; /* Preenche gaps automaticamente */
}

/* Classes de span de coluna */
.dashboard-card.column-span-1 {
  grid-column: span 1;
}

.dashboard-card.column-span-2 {
  grid-column: span 2;
}

.dashboard-card.column-span-3 {
  grid-column: span 3;
}

/* Transições suaves ao redimensionar */
.dashboard-card {
  transition: grid-column 0.3s ease, transform 0.2s, box-shadow 0.2s;
  position: relative;
}

/* Modo de Edição */
.dashboard-edit-mode .dashboard-card {
  cursor: pointer;
  position: relative;
}

.dashboard-card.edit-mode {
  border: 2px dashed #d1d5db;
}

.dashboard-card.edit-mode:hover {
  border-color: #3b82f6;
  transform: translateY(-2px);
}

/* Controles de Edição */
.edit-controls {
  display: flex;
  gap: 8px;
  padding: 10px;
  background: white;
  border-bottom: 1px solid #e5e7eb;
  align-items: center;
}

.edit-controls button {
  padding: 6px 10px;
  border: 1px solid #e5e7eb;
  background: white;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 14px;
  color: #6b7280;
}

.edit-controls button:hover {
  background: #f3f4f6;
  color: #111827;
}

.drag-handle {
  cursor: grab;
}

.drag-handle:active {
  cursor: grabbing;
}

/* Drag-and-Drop Visual Feedback */
.dashboard-card.dragging {
  opacity: 0.5;
  cursor: grabbing;
}

.dashboard-card.drag-over {
  border: 2px dashed #3b82f6;
  background: rgba(59, 130, 246, 0.05);
}

.edit-btn {
  color: #3b82f6 !important;
}

.toggle-btn {
  color: #6b7280 !important;
}

.toggle-btn.active {
  color: #10b981 !important;
}

.delete-btn {
  color: #ef4444 !important;
  margin-left: auto;
}

/* Seletor Rápido de Largura */
.quick-width-selector {
  display: flex;
  gap: 4px;
  background: white;
  border-radius: 4px;
  padding: 4px;
  border: 1px solid #e5e7eb;
}

.width-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: none;
  background: transparent;
  border-radius: 3px;
  cursor: pointer;
  font-size: 12px;
  color: #6b7280;
  transition: all 0.2s;
  white-space: nowrap;
}

.width-btn .width-icon {
  font-size: 14px;
  line-height: 1;
}

.width-btn .width-label {
  font-size: 11px;
  font-weight: 500;
  line-height: 1;
}

.width-btn:hover {
  background: #f3f4f6;
  color: #111827;
}

.width-btn.active {
  background: #3b82f6;
  color: white;
}

.width-btn.active .width-icon,
.width-btn.active .width-label {
  color: white;
}

/* Informações do Painel (modo edição) */
.panel-info {
  padding: 12px 15px;
  background: #f9fafb;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.info-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #6b7280;
}

.info-item i {
  color: #9ca3af;
}

.panel-query-preview {
  padding: 12px 15px;
  border-top: 1px solid #e5e7eb;
}

.panel-query-preview strong {
  display: block;
  font-size: 12px;
  color: #6b7280;
  margin-bottom: 6px;
}

.panel-query-preview p {
  font-size: 13px;
  color: #374151;
  margin: 0;
  line-height: 1.5;
}

/* Painel Desativado */
.dashboard-card.disabled {
  opacity: 0.6;
  position: relative;
}

.disabled-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  color: #6b7280;
  font-size: 14px;
  z-index: 10;
}

/* Indicador de ajuste responsivo */
.dashboard-card.column-adjusted::after {
  content: '📱 Ajustado';
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(245, 158, 11, 0.9);
  color: white;
  padding: 3px 8px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 600;
}

/* ========================================
   MODAL STYLES (Agent Selector & Configurator)
   ======================================== */

.agent-selector-modal,
.panel-configurator-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(2px);
}

.modal-content {
  position: relative;
  background: white;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

.agent-selector-content {
  max-width: 800px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid #e5e7eb;
}

.modal-header h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  color: #111827;
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-close-btn {
  background: none;
  border: none;
  font-size: 24px;
  color: #6b7280;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
  transition: color 0.2s;
}

.modal-close-btn:hover {
  color: #111827;
}

.modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}

.modal-footer {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  padding: 16px 24px;
  border-top: 1px solid #e5e7eb;
}

/* ========================================
   AGENT SELECTOR STYLES
   ======================================== */

.agent-filters {
  display: flex;
  gap: 16px;
  margin-bottom: 20px;
}

.filter-group {
  flex: 1;
}

.filter-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: #374151;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.agent-search-input,
.agent-filter-select {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
  transition: border-color 0.2s;
}

.agent-search-input:focus,
.agent-filter-select:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.agent-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 400px;
  overflow-y: auto;
}

.agent-list-loading,
.agent-list-empty {
  text-align: center;
  padding: 40px 20px;
  color: #6b7280;
}

.agent-list-loading i {
  font-size: 32px;
  margin-bottom: 12px;
  color: #3b82f6;
}

.agent-list-empty i {
  font-size: 48px;
  margin-bottom: 12px;
  color: #d1d5db;
}

.agent-card {
  display: flex;
  gap: 16px;
  padding: 16px;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  background: white;
}

.agent-card:hover {
  border-color: #3b82f6;
  background: #f0f9ff;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.1);
}

.agent-card-icon {
  font-size: 32px;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f9fafb;
  border-radius: 8px;
}

.agent-card-content {
  flex: 1;
}

.agent-card-title {
  margin: 0 0 4px 0;
  font-size: 16px;
  font-weight: 600;
  color: #111827;
}

.agent-card-subtitle {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #6b7280;
  margin-bottom: 8px;
}

.agent-card-description {
  font-size: 13px;
  color: #4b5563;
  margin: 0 0 8px 0;
  line-height: 1.5;
}

.agent-card-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.agent-type-badge,
.agent-response-badge {
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.agent-type-badge {
  background: #e0e7ff;
  color: #3730a3;
}

.agent-type-badge.agent-type-chat {
  background: #dbeafe;
  color: #1e40af;
}

.agent-type-badge.agent-type-api {
  background: #d1fae5;
  color: #065f46;
}

.agent-response-badge {
  background: #f3f4f6;
  color: #4b5563;
}

.agent-select-btn {
  padding: 8px 16px;
  background: #3b82f6;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: background 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.agent-select-btn:hover {
  background: #2563eb;
}

/* ========================================
   PANEL CONFIGURATOR STYLES
   ======================================== */

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: #374151;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.form-control {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.2s;
}

.form-control:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

textarea.form-control {
  resize: vertical;
}

/* Selected Agent Display */
.selected-agent-display {
  padding: 12px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
}

.agent-info-placeholder {
  text-align: center;
  color: #9ca3af;
  font-size: 13px;
  padding: 12px;
}

.selected-agent-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.agent-icon {
  font-size: 32px;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: white;
  border-radius: 8px;
}

.agent-details strong {
  display: block;
  font-size: 14px;
  color: #111827;
  margin-bottom: 2px;
}

.agent-details small {
  font-size: 12px;
  color: #6b7280;
}

/* Icon Selector */
.icon-selector {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.icon-option {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  background: white;
  cursor: pointer;
  transition: all 0.2s;
}

.icon-option:hover {
  border-color: #3b82f6;
  background: #f0f9ff;
}

.icon-option.selected {
  border-color: #3b82f6;
  background: #dbeafe;
}

/* Execution Mode Selector */
.execution-mode-selector {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.execution-option {
  display: flex;
  padding: 12px;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.execution-option:hover {
  border-color: #3b82f6;
  background: #f0f9ff;
}

.execution-option.selected {
  border-color: #3b82f6;
  background: #dbeafe;
}

.execution-option input[type="radio"] {
  display: none;
}

.execution-option .option-content {
  flex: 1;
}

.execution-option strong {
  display: block;
  color: #111827;
  margin-bottom: 4px;
}

.execution-option small {
  display: block;
  color: #6b7280;
  font-size: 12px;
}

/* Schedule Config */
.schedule-config {
  padding: 12px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
}

.schedule-inputs {
  display: flex;
  gap: 12px;
}

.schedule-interval-input {
  flex: 1;
}

.schedule-unit-select {
  flex: 1;
}

/* ========================================
   COLUMN SPAN SELECTOR
   ======================================== */

.column-span-selector {
  margin: 20px 0;
}

.selector-label {
  display: block;
  font-weight: 600;
  margin-bottom: 12px;
  color: #374151;
}

.span-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.span-option {
  display: block;
  padding: 12px;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.span-option:hover {
  border-color: #3b82f6;
  background: #f0f9ff;
}

.span-option.selected {
  border-color: #3b82f6;
  background: #dbeafe;
}

.span-option input[type="radio"] {
  display: none;
}

.option-content {
  display: flex;
  align-items: center;
  gap: 15px;
}

.option-icon {
  font-size: 24px;
  color: #6b7280;
}

.span-option.selected .option-icon {
  color: #3b82f6;
}

.option-details {
  flex: 1;
}

.option-details strong {
  display: block;
  color: #111827;
  margin-bottom: 4px;
}

.option-details small {
  display: block;
  color: #6b7280;
  font-size: 13px;
}

/* Layout Preview */
.layout-preview {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 15px;
  padding: 15px;
  background: #f9fafb;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
}

.layout-preview-cell {
  height: 60px;
  border: 2px dashed #d1d5db;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  background: white;
}

.layout-preview-cell.active {
  background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
  border-color: #3b82f6;
  border-style: solid;
}

.responsive-note {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding: 10px;
  background: #fffbeb;
  border-left: 3px solid #f59e0b;
  border-radius: 4px;
  font-size: 13px;
  color: #92400e;
}

.responsive-note i {
  color: #f59e0b;
}

/* ========================================
   BUTTONS
   ======================================== */

.btn {
  padding: 10px 20px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-primary {
  background: #3b82f6;
  color: white;
}

.btn-primary:hover {
  background: #2563eb;
}

.btn-secondary {
  background: #e5e7eb;
  color: #374151;
}

.btn-secondary:hover {
  background: #d1d5db;
}

/* ========================================
   TOAST NOTIFICATIONS
   ======================================== */

.toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: white;
  padding: 16px 20px;
  border-radius: 8px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 2000;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s;
  max-width: 400px;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.toast-content {
  display: flex;
  align-items: center;
  gap: 12px;
}

.toast.toast-success {
  border-left: 4px solid #10b981;
}

.toast.toast-error {
  border-left: 4px solid #ef4444;
}

.toast.toast-info {
  border-left: 4px solid #3b82f6;
}

.toast.toast-warning {
  border-left: 4px solid #f59e0b;
}

.toast i {
  font-size: 20px;
}

.toast.toast-success i {
  color: #10b981;
}

.toast.toast-error i {
  color: #ef4444;
}

.toast.toast-info i {
  color: #3b82f6;
}

.toast.toast-warning i {
  color: #f59e0b;
}

/* ========================================
   RESPONSIVE BREAKPOINTS
   ======================================== */

@media (max-width: 767px) {
  .dashboard-grid {
    grid-template-columns: 1fr !important;
  }

  .dashboard-card {
    grid-column: span 1 !important;
  }

  .modal-content {
    max-width: 100%;
    margin: 0;
    border-radius: 0;
  }

  .agent-filters {
    flex-direction: column;
  }
}

@media (min-width: 768px) and (max-width: 1023px) {
  .dashboard-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) and (max-width: 1439px) {
  .dashboard-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1440px) {
  .dashboard-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}
