/* =============================================================================
   ESTILO UNIFICADO DA APLICAÇÃO
   Baseado no profile.html - Layout limpo e centralizado
   ============================================================================ */

/* =============================================================================
   LAYOUT GERAL
   ============================================================================ */
.app-content {
  padding-bottom: 100px; /* Espaço suficiente para o footer fixo */
}

.stat-card {
  background: linear-gradient(145deg, rgba(255,255,255,0.98) 0%, rgba(224,242,254,0.6) 100%);
  border-radius: 1rem;
  padding: 1.25rem;
  box-shadow: 0 6px 24px rgba(6, 182, 212, 0.12), 0 2px 8px rgba(249, 115, 22, 0.06);
  border: 1px solid rgba(6, 182, 212, 0.15);
  text-align: center;
  transition: all 0.3s ease;
}

.stat-card:hover {
  box-shadow: 0 10px 32px rgba(6, 182, 212, 0.18), 0 4px 12px rgba(249, 115, 22, 0.1);
  transform: translateY(-2px);
}

.view-card {
  background: white;
  border-radius: 1rem;
  box-shadow: 0 10px 32px rgba(6, 182, 212, 0.12), 0 4px 16px rgba(249, 115, 22, 0.06);
  border: 1px solid rgba(6, 182, 212, 0.15);
  overflow: hidden;
  transition: all 0.3s ease;
}

.view-card:hover {
  box-shadow: 0 14px 40px rgba(6, 182, 212, 0.18), 0 6px 20px rgba(249, 115, 22, 0.1);
}

.view-card-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgba(6, 182, 212, 0.12);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, rgba(224, 242, 254, 0.6) 0%, rgba(254, 243, 199, 0.3) 100%);
}

.view-card-body {
  padding: 1.25rem;
  background: white;
}

/* Badges e contadores dentro dos headers */
.view-card-header .rounded-full {
  background: rgba(6, 182, 212, 0.15);
}

/* Ícones circulares sem background explícito */
.view-card .flex.items-center.justify-center.rounded-full:not([class*="bg-"]) {
  background: linear-gradient(135deg, rgba(224, 242, 254, 0.8) 0%, rgba(254, 243, 199, 0.4) 100%);
}

.trip-card {
  background: linear-gradient(145deg, #ffffff 0%, rgba(224, 242, 254, 0.5) 100%);
  border-radius: 0.75rem;
  box-shadow: 0 6px 20px rgba(6, 182, 212, 0.1), 0 2px 8px rgba(249, 115, 22, 0.05);
  border: 1px solid rgba(6, 182, 212, 0.12);
  overflow: hidden;
  transition: all 0.25s ease;
}

.trip-card:hover {
  box-shadow: 0 12px 32px rgba(6, 182, 212, 0.18), 0 4px 12px rgba(249, 115, 22, 0.1);
  transform: translateY(-3px);
  border-color: #f97316;
  background: linear-gradient(145deg, #ffffff 0%, rgba(254, 243, 199, 0.4) 100%);
}

.list-surface {
  background: linear-gradient(180deg, rgba(224, 242, 254, 0.6) 0%, rgba(254, 243, 199, 0.2) 100%);
}

.client-card {
  background: linear-gradient(145deg, #ffffff 0%, rgba(224, 242, 254, 0.5) 100%);
  border-radius: 0.75rem;
  box-shadow: 0 6px 20px rgba(6, 182, 212, 0.1), 0 2px 8px rgba(249, 115, 22, 0.05);
  border: 1px solid rgba(6, 182, 212, 0.12);
  overflow: hidden;
  transition: all 0.25s ease;
}

.client-card:hover {
  box-shadow: 0 12px 32px rgba(6, 182, 212, 0.18), 0 4px 12px rgba(249, 115, 22, 0.1);
  transform: translateY(-3px);
  border-color: #06b6d4;
  background: linear-gradient(145deg, #ffffff 0%, rgba(224, 242, 254, 0.7) 100%);
}

/* =============================================================================
   FOOTER FIXO DE AÇÕES
   ============================================================================ */
.page-actions-footer {
  position: fixed;
  bottom: 0;
  left: 224px; /* Início após o menu lateral (w-56 = 14rem = 224px) */
  right: 0;
  padding: 1rem 2rem;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  z-index: 1030;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
}

.page-actions-footer .d-flex {
  max-width: calc(100% - 200px); /* Margem para o chat */
  margin: 0 auto;
}

@media (max-width: 1200px) {
  .page-actions-footer .d-flex {
    max-width: calc(100% - 200px);
  }
}

@media (max-width: 992px) {
  .page-actions-footer .d-flex {
    max-width: calc(100% - 200px);
  }
}

@media (max-width: 768px) {
  .page-actions-footer {
    left: 0; /* Em mobile, ocupa toda a largura */
  }
  .page-actions-footer .d-flex {
    max-width: 100%;
    padding: 0 1rem;
  }
}


.color-preview {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  border: 2px solid #dee2e6;
  cursor: pointer;
  transition: transform 0.2s;
}

.color-preview:hover {
  transform: scale(1.1);
}

.logo-preview {
  max-height: 80px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.token-field {
  font-family: 'Courier New', monospace;
  background: #f8f9fa;
}

.icon-large {
  font-size: 1.5rem;
  color: #6c757d;
}


/* =============================================================================
   BOTÕES UNIFICADOS
   ============================================================================ */
.btn {
  border-radius: 6px;
  font-weight: 500;
  transition: all 0.2s ease;
  border-width: 1px;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

.btn-primary {
  background-color: var(--bs-primary, #ff8c42);
  border-color: var(--bs-primary, #ff8c42);
  color: white;
}

.btn-primary:hover,
.btn-primary:focus {
  background-color: color-mix(in srgb, var(--bs-primary, #ff8c42) 85%, white);
  border-color: color-mix(in srgb, var(--bs-primary, #ff8c42) 85%, white);
  color: white;
}

.btn-secondary {
  background-color: var(--bs-secondary, #6c757d);
  border-color: var(--bs-secondary, #6c757d);
  color: white;
}

.btn-secondary:hover,
.btn-secondary:focus {
  background-color: color-mix(in srgb, var(--bs-secondary, #6c757d) 85%, white);
  border-color: color-mix(in srgb, var(--bs-secondary, #6c757d) 85%, white);
  color: white;
}

.btn-outline-primary {
  color: var(--bs-primary, #ff8c42);
  border-color: var(--bs-primary, #ff8c42);
}

.btn-outline-primary:hover {
  background-color: var(--bs-primary, #ff8c42);
  color: white;
}

.btn-outline-secondary {
  color: var(--bs-secondary, #6c757d);
  border-color: var(--bs-secondary, #6c757d);
}

.btn-outline-secondary:hover {
  background-color: var(--bs-secondary, #6c757d);
  color: white;
}

.btn-sm {
  padding: 0.375rem 0.75rem;
  font-size: 0.875rem;
}

.btn-lg {
  padding: 0.75rem 1.5rem;
  font-size: 1.125rem;
}

/* =============================================================================
   FORMULÁRIOS
   ============================================================================ */
.form-label {
  font-weight: 600;
  color: var(--bs-gray-700);
  margin-bottom: 0.5rem;
}

.form-control {
  border-radius: 6px;
  border: 1px solid #ced4da;
  transition: all 0.2s ease;
}

.form-control:focus {
  border-color: var(--bs-primary, #ff8c42);
  box-shadow: 0 0 0 0.2rem rgba(255, 140, 66, 0.25);
}

.form-control::placeholder {
  color: #adb5bd !important;
  opacity: 0.7 !important;
  font-style: italic;
}

.form-select {
  border-radius: 6px;
  border: 1px solid #ced4da;
}

.form-select:focus {
  border-color: var(--bs-primary, #ff8c42);
  box-shadow: 0 0 0 0.2rem rgba(255, 140, 66, 0.25);
}

.form-control-color {
  border-radius: 6px;
  border: 1px solid #ced4da;
  width: 100%;
  height: 38px;
}

.form-check-input {
  border-radius: 4px;
}

.form-check-input:checked {
  background-color: var(--bs-primary, #ff8c42);
  border-color: var(--bs-primary, #ff8c42);
}

/* =============================================================================
   INPUT GROUP
   ============================================================================ */
.input-group-text {
  border-radius: 6px 0 0 6px;
  border: 1px solid #ced4da;
  background-color: #f8f9fa;
}

.input-group .form-control:first-child {
  border-radius: 6px 0 0 6px;
}

.input-group .form-control:last-child {
  border-radius: 0 6px 6px 0;
}

.input-group .input-group-text:first-child {
  border-radius: 6px 0 0 6px;
}

.input-group .input-group-text:last-child {
  border-radius: 0 6px 6px 0;
}

/* =============================================================================
   BADGES
   ============================================================================ */
.badge {
  border-radius: 4px;
  font-weight: 500;
}

/* =============================================================================
   ALERTS
   ============================================================================ */
.alert {
  border-radius: 6px;
  border: none;
}

.alert-success {
  background-color: #d1e7dd;
  color: #0f5132;
  border-left: 4px solid #198754;
}

.alert-warning {
  background-color: #fff3cd;
  color: #664d03;
  border-left: 4px solid #ffc107;
}

.alert-danger {
  background-color: #f8d7da;
  color: #721c24;
  border-left: 4px solid #dc3545;
}

.alert-info {
  color: #087990;
  background-color: #cff4fc;
  border-left: 4px solid #0dcaf0;
}

.alert-light {
  color: #6c757d;
  background-color: #f8f9fa;
  border-left: 4px solid #f8f9fa;
}

/* =============================================================================
   TABLES
   ============================================================================ */
.table {
  border-radius: 8px;
  overflow: hidden;
}

.table th {
  background-color: #f8f9fa;
  border-bottom: 2px solid #dee2e6;
  font-weight: 600;
  color: var(--bs-gray-700);
}

.table-hover tbody tr:hover {
  background-color: rgba(255, 140, 66, 0.05);
}

/* =============================================================================
   MODALS
   ============================================================================ */
.modal-content {
  border-radius: 12px;
  border: none;
  box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

.modal-header {
  background: linear-gradient(135deg, color-mix(in srgb, var(--bs-primary, #ff8c42) 8%, white) 0%, color-mix(in srgb, var(--bs-secondary, #8b7355) 8%, white) 100%);
  border-bottom: 1px solid color-mix(in srgb, var(--bs-primary, #ff8c42) 20%, white);
  border-radius: 12px 12px 0 0;
}

.modal-title {
  color: var(--bs-primary, #ff8c42);
  font-weight: 600;
}

.modal-footer {
  background: #f8f9fa;
  border-top: 1px solid #dee2e6;
  border-radius: 0 0 12px 12px;
}

/* =============================================================================
   PAGINAÇÃO
   ============================================================================ */
.page-link {
  border-radius: 6px;
  border: 1px solid #dee2e6;
  color: var(--bs-primary, #ff8c42);
}

.page-link:hover {
  background-color: var(--bs-primary, #ff8c42);
  border-color: var(--bs-primary, #ff8c42);
  color: white;
}

.page-item.active .page-link {
  background-color: var(--bs-primary, #ff8c42);
  border-color: var(--bs-primary, #ff8c42);
  color: white;
}

/* =============================================================================
   BREADCRUMBS
   ============================================================================ */
.breadcrumb {
  background-color: #f8f9fa;
  border-radius: 6px;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
}

.breadcrumb-item + .breadcrumb-item::before {
  color: var(--bs-primary, #ff8c42);
}

.breadcrumb-item.active {
  color: var(--bs-gray-500);
}

/* =============================================================================
   UTILITÁRIOS
   ============================================================================ */
.text-muted {
  color: #6c757d !important;
}

.text-primary {
  color: var(--bs-primary, #ff8c42) !important;
}

.text-secondary {
  color: var(--bs-secondary, #6c757d) !important;
}

.text-success {
  color: #198754 !important;
}

.text-danger {
  color: #dc3545 !important;
}

.text-warning {
  color: #ffc107 !important;
}

.text-info {
  color: #0dcaf0 !important;
}

.bg-primary {
  background-color: var(--bs-primary, #ff8c42) !important;
}

.bg-secondary {
  background-color: var(--bs-secondary, #6c757d) !important;
}


.bg-light {
  background-color: #f8f9fa !important;
}

/* =============================================================================
   RESPONSIVE
   ============================================================================ */
@media (max-width: 768px) {
  .main-content {
    padding: 1rem 0;
  }
  
  .card-header {
    padding: 0.75rem 1rem;
  }
  
  .card-body {
    padding: 1rem;
  }
  
  .card-footer {
    padding: 0.75rem 1rem;
  }
  
  .btn-group-sm .btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.8125rem;
  }
}

/* =============================================================================
   ANIMAÇÕES
   ============================================================================ */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-in {
  animation: fadeIn 0.3s ease-out;
}

/* =============================================================================
   COMPONENTES ESPECÍFICOS
   ============================================================================ */
.profile-thumbnail {
  display: none !important;
}

.profile-img:not([src]) + .profile-thumbnail,
.profile-img[src=""] + .profile-thumbnail {
  display: flex !important;
}

/* Phone Row Compact */
.phone-row {
  background: #f8f9fa;
  padding: 6px 8px;
  border-radius: 6px;
  margin-bottom: 4px;
}

/* Service Types */
.color-square {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  border: 1px solid #dee2e6;
}

/* Preview Components */
.preview-icon {
  text-align: center;
}

.preview-content {
  text-align: center;
}

/* Trip Cards */
.trip-ongoing {
  border-left: 4px solid var(--bs-primary, #ff8c42);
}

.trip-upcoming {
  border-left: 4px solid var(--bs-secondary, #8b7355);
}

.trip-past {
  border-left: 4px solid var(--bs-gray-400);
}

/* Status Indicators */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 500;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: currentColor;
}

/* =============================================================================
   WIDTH UTILITIES
   ============================================================================ */
.width-80 {
  width: 80px !important;
}

.width-100 {
  width: 100px !important;
}

/* =============================================================================
   COMMISSION RULES
   ============================================================================ */
.commission-rules-table th[style*="width: 80px"] {
  width: 80px !important;
}

.commission-rules-table th[style*="width: 100px"] {
  width: 100px !important;
}

.empty-state-icon {
  font-size: 4rem;
  color: #dee2e6;
}

.delete-form-inline {
  display: inline;
}

/* =============================================================================
   SERVICE TYPES
   ============================================================================ */
.service-type-icon {
  color: var(--service-color, #6c757d);
}

.service-type-table th[style*="width:100px"] {
  width: 100px !important;
}

.service-type-table th[style*="width:80px"] {
  width: 80px !important;
}

.text-uppercase-input {
  text-transform: uppercase;
}

/* =============================================================================
   PLATFORM CONFIG
   ============================================================================ */
.config-favicon {
  max-height: 32px;
}

.config-logo {
  height: 30px;
  margin-right: 10px;
}

.config-preview-header {
  background-color: var(--config-header-color, #013e59);
}

.config-btn-primary {
  background-color: var(--config-primary-color, #00acfe);
  color: white;
}

.config-btn-secondary {
  background-color: var(--config-secondary-color, #9da4b1);
  color: white;
}

.config-badge-accent {
  background-color: var(--config-accent-color, #ff8404);
}

.config-badge-secondary {
  background-color: var(--config-secondary-color, #9da4b1);
}

/* CSS Variables for platform config - set via inline style in template */
:root {
  --config-header-color: #013e59;
  --config-primary-color: #00acfe;
  --config-secondary-color: #9da4b1;
  --config-accent-color: #ff8404;
  --bs-body-font-size: 13px;
  --bs-nav-link-font-size: 13px;
}

/* =============================================================================
   FORMULA EDITOR
   ============================================================================ */
#formulaEditorContainer {
  border: 1px solid #dee2e6;
  border-radius: 0.375rem;
  overflow: hidden;
}

#formulaEditorContainer.is-invalid {
  border-color: #dc3545;
}

#formulaEditorContainer.is-valid {
  border-color: var(--color-accent);
}

#formulaEditor {
  height: 80px;
  border: none;
  background: #ffffff;
}

.formula-toolbar {
  background: #f8f9fa;
  border-bottom: 1px solid #dee2e6;
  padding: 0.5rem;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.formula-toolbar .btn {
  font-family: monospace;
  font-size: 0.85rem;
}

.formula-help {
  font-size: 0.8rem;
  padding: 0.5rem;
  background: #e9ecef;
  border-top: 1px solid #dee2e6;
}

/* =============================================================================
   TOM SELECT - DROPDOWN Z-INDEX FIX
   ============================================================================ */
.ts-dropdown {
  z-index: 9999 !important;
}

.ts-wrapper {
  position: relative;
  z-index: 1;
}

.ts-wrapper.dropdown-active {
  z-index: 9998;
}

/* =============================================================================
   EVENTOS - ESTILOS PARTILHADOS
   ============================================================================ */

/* Hero de sub-páginas de eventos */
.event-hero {
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  position: relative;
  overflow: hidden;
}
.event-hero::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 60%;
  height: 200%;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="50" cy="50" r="40" fill="rgba(255,255,255,0.03)"/></svg>');
  background-size: 100px;
}
.event-hero.with-cover { background: none; }
.event-hero .cover-bg { position: absolute; inset: 0; object-fit: cover; width: 100%; height: 100%; }
.event-hero .cover-overlay { position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,0.7), rgba(0,0,0,0.2)); }

/* Cards de conteúdo */
.ev-card {
  background: white;
  border-radius: 1rem;
  box-shadow: 0 4px 20px rgba(0,0,0,0.06);
  overflow: hidden;
}
.ev-card-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fafbfc;
}
.ev-card-title {
  font-weight: 700;
  font-size: 1rem;
  color: #1e293b;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
}
.ev-card-body { padding: 1.25rem; }

/* Stat cards de eventos */
.ev-stat {
  background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
  border-radius: 1rem;
  padding: 1.25rem;
  border: 1px solid #e2e8f0;
  transition: all 0.2s ease;
  height: 100%;
}
.ev-stat:hover {
  border-color: #6366f1;
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
  transform: translateY(-2px);
}
.ev-stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  margin-bottom: 0.75rem;
}
.ev-stat-icon.primary { background: linear-gradient(135deg, #6366f1, #4f46e5); color: white; }
.ev-stat-icon.success { background: linear-gradient(135deg, #10b981, #059669); color: white; }
.ev-stat-icon.warning { background: linear-gradient(135deg, #f59e0b, #d97706); color: white; }
.ev-stat-icon.info { background: linear-gradient(135deg, #06b6d4, #0891b2); color: white; }
.ev-stat-icon.danger { background: linear-gradient(135deg, #ef4444, #dc2626); color: white; }
.ev-stat-icon.purple { background: linear-gradient(135deg, #8b5cf6, #6d28d9); color: white; }
.ev-stat-value { font-size: 1.75rem; font-weight: 800; color: #1e293b; line-height: 1; margin-bottom: 0.25rem; }
.ev-stat-label { font-size: 0.75rem; color: #64748b; font-weight: 600; text-transform: uppercase; }

/* Status badges */
.ev-badge { padding: 0.25rem 0.75rem; border-radius: 9999px; font-size: 0.75rem; font-weight: 600; display: inline-block; }
.ev-badge-pending { background: #fef3c7; color: #92400e; }
.ev-badge-confirmed { background: #d1fae5; color: #065f46; }
.ev-badge-waitlist { background: #dbeafe; color: #1e40af; }
.ev-badge-cancelled { background: #fee2e2; color: #991b1b; }
.ev-badge-paid { background: #d1fae5; color: #065f46; }

/* Category badges */
.ev-category { padding: 0.2rem 0.5rem; border-radius: 0.375rem; font-size: 0.7rem; font-weight: 600; background: #e0e7ff; color: #4338ca; }

/* Service item cards */
.ev-service {
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  padding: 1rem;
  transition: all 0.2s ease;
}
.ev-service:hover {
  border-color: #6366f1;
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}

/* Event cards (public list) */
.ev-event-card {
  background: white;
  border-radius: 1rem;
  box-shadow: 0 4px 20px rgba(0,0,0,0.06);
  overflow: hidden;
  transition: all 0.3s ease;
  border: 1px solid #e2e8f0;
}
.ev-event-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.12);
  border-color: #6366f1;
}
.ev-event-cover {
  height: 140px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  position: relative;
  overflow: hidden;
}
.ev-event-cover img { width: 100%; height: 100%; object-fit: cover; }

/* Data tables */
.ev-table { width: 100%; font-size: 0.875rem; }
.ev-table thead tr { border-bottom: 1px solid #f1f5f9; background: rgba(248,250,252,0.5); }
.ev-table th { text-align: left; padding: 0.75rem 1rem; font-weight: 600; color: #475569; }
.ev-table tbody tr { border-bottom: 1px solid #f8fafc; transition: background 0.15s; }
.ev-table tbody tr:hover { background: rgba(248,250,252,0.5); }
.ev-table td { padding: 0.75rem 1rem; }

/* Filter bar */
.ev-filters {
  background: white;
  border-radius: 1rem;
  box-shadow: 0 4px 20px rgba(0,0,0,0.06);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

/* Empty state */
.ev-empty {
  text-align: center;
  padding: 3rem 2rem;
  color: #64748b;
}
.ev-empty i { font-size: 2.5rem; opacity: 0.4; margin-bottom: 0.75rem; display: block; }
.ev-empty p { font-weight: 600; margin-bottom: 0.25rem; }
.ev-empty .sub { font-size: 0.875rem; font-weight: 400; }
}