/* =============================================================================
   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: 250px; /* Início após o menu lateral */
  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: 14px;
  --bs-nav-link-font-size:14px;
}

/* =============================================================================
   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;
}