/* ========================================
   DESIGN SYSTEM PROFISSIONAL
   Nova Paleta: Azul Slate + Cyan/Teal
   ======================================== */

:root {
  /* Cores primárias - Azul/Cyan Profissional */
  --primary-50: #ecfeff;
  --primary-100: #cffafe;
  --primary-200: #a5f3fc;
  --primary-300: #67e8f9;
  --primary-400: #22d3ee;
  --primary-500: #0ea5e9;
  --primary-600: #0284c7;
  --primary-700: #0369a1;
  --primary-800: #075985;
  
  /* Cores neutras - Slate moderno */
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1e293b;
  --gray-900: #0f172a;
  
  /* Cores semânticas */
  --success: #10b981;
  --warning: #f59e0b;
  --error: #ef4444;
  --info: #06b6d4;
  
  /* Tema claro */
  --bg: #ffffff;
  --bg-secondary: #f8fafc;
  --surface: #ffffff;
  --surface-hover: #f8fafc;
  --text-primary: #0f172a;
  --text-secondary: #64748b;
  --text-tertiary: #94a3b8;
  --border: #e2e8f0;
  --border-light: #f1f5f9;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
  --shadow-2xl: 0 25px 50px -12px rgb(0 0 0 / 0.25);
  
  /* Gradientes */
  --gradient-primary: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
  --gradient-surface: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
  --gradient-hover: linear-gradient(145deg, #f8fafc 0%, #f1f5f9 100%);
  
  /* Bordas */
  --radius-sm: 0.5rem;
  --radius-md: 0.75rem;
  --radius-lg: 1rem;
  --radius-xl: 1.5rem;
  --radius-2xl: 2rem;
  --radius-full: 9999px;
}

[data-theme="dark"] {
  --bg: #0f172a;
  --bg-secondary: #1e293b;
  --surface: #1e293b;
  --surface-hover: #334155;
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-tertiary: #64748b;
  --border: #334155;
  --border-light: #1e293b;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.4);
  --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.5), 0 1px 2px -1px rgb(0 0 0 / 0.5);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.5), 0 2px 4px -2px rgb(0 0 0 / 0.5);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.6), 0 4px 6px -4px rgb(0 0 0 / 0.6);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.6), 0 8px 10px -6px rgb(0 0 0 / 0.6);
  --shadow-2xl: 0 25px 50px -12px rgb(0 0 0 / 0.7);
  --gradient-surface: linear-gradient(145deg, #1e293b 0%, #334155 100%);
  --gradient-hover: linear-gradient(145deg, #334155 0%, #475569 100%);
  --gradient-primary: linear-gradient(135deg, #0ea5e9 0%, #06b6d4 100%);
}

/* ========================================
   RESET & BASE
   ======================================== */

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  height: 100%;
  overflow-x: hidden;
  max-width: 100vw;
}

body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.6;
}

#app-shell {
  display: flex;
  flex-direction: column;
  flex: 1;
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
}

/* ========================================
   TOPBAR - Design Moderno
   ======================================== */

.topbar {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.5rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 120;
  backdrop-filter: blur(20px) saturate(180%);
  background: rgba(255, 255, 255, 0.8);
  box-shadow: var(--shadow-sm);
  transition: all 0.3s ease;
}

[data-theme="dark"] .topbar {
  background: rgba(30, 41, 59, 0.8);
}

.brand {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.brand > span {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.brand small {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
}

/* Status indicator */
.status-area {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.status-dot {
  width: 0.625rem;
  height: 0.625rem;
  border-radius: var(--radius-full);
  animation: pulse-dot 2s ease-in-out infinite;
}

.status-dot.status-ok {
  background: var(--success);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

.status-dot.status-syncing {
  background: var(--warning);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2);
}

.status-dot.status-error {
  background: var(--error);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2);
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.7; transform: scale(1.1); }
}

/* Action buttons */
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.icon-action {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-primary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.icon-action:hover {
  background: var(--surface-hover);
  border-color: var(--primary-300);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.icon-action:active {
  transform: translateY(0);
}

.icon-action svg,
.menu-orb__item svg {
  width: 1.25rem;
  height: 1.25rem;
  fill: currentColor;
}

/* Menu orb - Botão flutuante principal */
.menu-orb {
  position: relative;
  z-index: 9998;
}

.menu-orb__trigger {
  width: 3rem;
  height: 3rem;
  border-radius: var(--radius-full);
  border: none;
  background: var(--gradient-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-lg);
  position: relative;
  transition: all 0.3s ease;
}

.menu-orb__trigger:hover {
  transform: scale(1.05);
  box-shadow: var(--shadow-xl);
}

.menu-orb__trigger:active {
  transform: scale(0.95);
}

.menu-orb__trigger span {
  position: absolute;
  width: 0.375rem;
  height: 0.375rem;
  border-radius: var(--radius-full);
  background: #fff;
  transition: all 0.2s ease;
}

.menu-orb__trigger span:nth-child(1) {
  transform: translate(-0.625rem, -0.625rem);
}

.menu-orb__trigger span:nth-child(2) {
  transform: translate(0, 0);
}

.menu-orb__trigger span:nth-child(3) {
  transform: translate(0.625rem, 0.625rem);
}

.menu-orb__items {
  position: absolute;
  top: 3.5rem;
  right: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-10px) scale(0.95);
  transition: all 0.2s ease;
  z-index: 9999;
}

.menu-orb__items.show {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.menu-orb__item {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-primary);
  box-shadow: var(--shadow-lg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.menu-orb__item:hover {
  background: var(--surface-hover);
  transform: scale(1.1);
}

.menu-orb__item:active {
  transform: scale(0.95);
}

/* ========================================
   MAIN CONTENT
   ======================================== */

#main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
  background: var(--bg-secondary);
}

.main-view {
  display: none;
  flex: 1;
  padding: 2rem 1rem 4rem;
}

.main-view.active {
  display: block;
}

.container {
  width: 100%;
  max-width: 42rem;
  margin: 0 auto;
}

/* ========================================
   CARDS - Design Glassmorphism
   ======================================== */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-2xl);
  padding: 2rem;
  box-shadow: var(--shadow-xl);
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--gradient-primary);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.card:hover::before {
  opacity: 1;
}

.topbar-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.back-btn {
  appearance: none;
  background: var(--surface-hover);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 0.625rem 1rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 600;
  min-height: 2.5rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
}

.back-btn:hover {
  background: var(--surface);
  border-color: var(--primary-400);
  transform: translateX(-2px);
}

.back-btn:active {
  transform: translateX(0);
}

/* ========================================
   TYPOGRAPHY
   ======================================== */

h1 {
  margin: 0 0 0.5rem 0;
  font-size: 2rem;
  text-align: center;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.sub {
  margin: 0 0 2rem 0;
  color: var(--text-secondary);
  text-align: center;
  font-size: 1rem;
  font-weight: 500;
}

.section-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  text-align: center;
  margin: 2rem 0 1.5rem 0;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

/* ========================================
   FORMS - Design Moderno
   ======================================== */

form {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

.row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 680px) {
  .row-2 {
    grid-template-columns: 1fr 1fr;
  }
  .row-3 {
    grid-template-columns: 2fr 1fr 1fr;
  }
}

.field {
  display: flex;
  flex-direction: column;
}

.label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  gap: 0.5rem;
}

.label-badge {
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  background: var(--primary-100);
  color: var(--primary-700);
  margin-left: 8px;
}

.label-badge.verified {
  background: var(--success);
  color: white;
}

label {
  font-size: 0.875rem;
  color: var(--text-primary);
  font-weight: 600;
  letter-spacing: 0.01em;
}

.help {
  margin-top: 0.375rem;
  font-size: 0.75rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Input fields - Design clean e moderno */
input[type="text"],
input[type="number"],
input[type="tel"],
input[type="search"],
select,
textarea {
  width: 100%;
  background: var(--surface);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.875rem 1rem;
  font-size: 0.9375rem;
  font-family: inherit;
  outline: none;
  transition: all 0.2s ease;
  font-weight: 500;
}

input::placeholder,
textarea::placeholder {
  color: var(--text-tertiary);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.1);
}

input:read-only {
  background: var(--bg-secondary);
  cursor: not-allowed;
  opacity: 0.6;
}

select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3E%3C/svg%3E");
  background-position: right 0.5rem center;
  background-repeat: no-repeat;
  background-size: 1.5rem 1.5rem;
  padding-right: 2.5rem;
}

/* Radio buttons - Design moderno */
.radio-group {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.radio-option {
  flex: 1;
  min-width: 120px;
}

.radio-option input[type="radio"] {
  display: none;
}

.radio-label {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.875rem 1rem;
  text-align: center;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 3rem;
}

.radio-label:hover {
  border-color: var(--primary-400);
  background: var(--surface-hover);
}

.radio-option input[type="radio"]:checked + .radio-label {
  background: var(--gradient-primary);
  border-color: var(--primary-600);
  color: #ffffff;
  box-shadow: var(--shadow-md);
}

/* Checkbox buttons - Design moderno */
.checkbox-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 3.5rem;
}

.checkbox-wrapper input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  width: 100%;
  justify-content: center;
  position: relative;
  z-index: 1;
}

.checkbox-label:hover {
  border-color: var(--primary-400);
  background: var(--surface-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.checkbox-box {
  position: relative;
  width: 1.5rem;
  height: 1.5rem;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  transition: all 0.2s ease;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.checkbox-box::after {
  content: '✓';
  position: absolute;
  color: #ffffff;
  font-size: 1rem;
  font-weight: 700;
  opacity: 0;
  transform: scale(0.5);
  transition: all 0.2s ease;
}

.checkbox-wrapper input[type="checkbox"]:checked + .checkbox-label {
  border-color: var(--primary-600);
  background: var(--surface-hover);
}

.checkbox-wrapper input[type="checkbox"]:checked + .checkbox-label .checkbox-box {
  background: var(--gradient-primary);
  border-color: var(--primary-600);
}

.checkbox-wrapper input[type="checkbox"]:checked + .checkbox-label .checkbox-box::after {
  opacity: 1;
  transform: scale(1);
}

.checkbox-text {
  font-size: 0.9375rem;
  font-weight: 600;
}

/* Address fields */
.address-fields {
  display: none;
}

.address-fields.visible {
  display: grid;
}

.conditional-field,
.conditional-section {
  display: none;
}

.conditional-field.show,
.conditional-section.show {
  display: block;
}

/* ========================================
   BUTTONS - Sistema de botões profissional
   ======================================== */

button {
  appearance: none;
  border: none;
  border-radius: var(--radius-md);
  padding: 0.75rem 1.5rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.9375rem;
  min-height: 2.75rem;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn-primary,
button[type="submit"] {
  background: var(--gradient-primary);
  color: #ffffff;
  box-shadow: var(--shadow-md);
}

.btn-primary:hover,
button[type="submit"]:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn-primary:active,
button[type="submit"]:active {
  transform: translateY(0);
  box-shadow: var(--shadow);
}

.primary {
  background: var(--primary-500);
  color: #ffffff;
}

.primary:hover {
  background: var(--primary-600);
}

.actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  margin-top: 1rem;
}

/* ========================================
   FILE UPLOADS - Design moderno
   ======================================== */

.file-input {
  display: none;
}

.upload-plus {
  appearance: none;
  background: var(--primary-500);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.875rem;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
}

.upload-plus:hover {
  background: var(--primary-600);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.upload-plus:active {
  transform: translateY(0);
}

.upload-btn {
  display: none;
}

.count-badge {
  background: var(--primary-500);
  color: #ffffff;
  border-radius: var(--radius-full);
  padding: 0.25rem 0.625rem;
  font-size: 0.75rem;
  font-weight: 700;
  min-width: 1.5rem;
  text-align: center;
}

.files-preview {
  width: 100%;
  margin-top: 1rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(5.5rem, 1fr));
  gap: 0.75rem;
}

.file-item {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
}

.file-item:hover {
  border-color: var(--primary-400);
  box-shadow: var(--shadow-md);
}

.file-preview-img {
  width: 100%;
  height: 4.5rem;
  object-fit: cover;
  border-radius: var(--radius-sm);
}

.file-preview-video {
  width: 100%;
  height: 4.5rem;
  object-fit: cover;
  border-radius: var(--radius-sm);
}

.file-icon {
  width: 100%;
  height: 4.5rem;
  background: var(--primary-100);
  color: var(--primary-700);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 700;
}

.file-info {
  width: 100%;
  text-align: center;
}

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

.file-size {
  font-size: 0.6875rem;
  color: var(--text-secondary);
}

.file-remove {
  position: absolute;
  top: 0.375rem;
  right: 0.375rem;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.file-remove:hover {
  background: var(--error);
  transform: scale(1.1);
}

.file-remove svg {
  width: 0.875rem;
  height: 0.875rem;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}

/* ========================================
   MODALS - Design elegante
   ======================================== */

.modal,
.cep-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 999;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  animation: fadeIn 0.2s ease-out;
}

.modal.show,
.cep-modal.show {
  display: flex;
}

.modal-content,
.cep-modal-content {
  background: var(--surface);
  border-radius: var(--radius-2xl);
  padding: 2rem;
  max-width: 28rem;
  width: 100%;
  box-shadow: var(--shadow-2xl);
  border: 1px solid var(--border);
  animation: slideUp 0.3s ease-out;
}

.modal-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 0 1rem 0;
  text-align: center;
  color: var(--text-primary);
}

.modal-text {
  font-size: 1rem;
  color: var(--text-secondary);
  margin: 0 0 1.5rem 0;
  text-align: center;
  line-height: 1.6;
}

.modal-text strong {
  color: var(--primary-600);
  font-weight: 700;
}

.modal-actions,
.cep-modal-actions {
  display: flex;
  gap: 0.75rem;
  flex-direction: column;
}

#bulk-validation-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

#bulk-validation-list li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.875rem;
}

#bulk-validation-list li i {
  color: var(--warning);
  flex-shrink: 0;
}

.btn-modal,
.cep-modal-btn {
  padding: 1rem 1.5rem;
  border-radius: var(--radius-md);
  border: none;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 3rem;
}

.btn-fill,
.cep-modal-btn.confirm {
  background: var(--primary-500);
  color: #ffffff;
  box-shadow: var(--shadow-md);
}

.btn-fill:hover,
.cep-modal-btn.confirm:hover {
  background: var(--primary-600);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn-skip,
.cep-modal-btn.cancel {
  background: var(--gray-200);
  color: var(--gray-700);
}

[data-theme="dark"] .btn-skip,
[data-theme="dark"] .cep-modal-btn.cancel {
  background: var(--gray-700);
  color: var(--gray-200);
}

.btn-skip:hover,
.cep-modal-btn.cancel:hover {
  background: var(--gray-300);
}

[data-theme="dark"] .btn-skip:hover,
[data-theme="dark"] .cep-modal-btn.cancel:hover {
  background: var(--gray-600);
}

/* CEP Modal specific */
.cep-modal-content h3 {
  color: var(--primary-600);
  font-size: 1.25rem;
  margin-bottom: 1rem;
  font-weight: 700;
}

.cep-modal-content #cep-modal-address {
  font-size: 1rem;
  line-height: 1.8;
  color: var(--text-primary);
  padding: 1rem;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  margin: 1rem 0;
  border: 1px solid var(--border);
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ========================================
   LOCATION & GPS
   ======================================== */

.location-box {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  text-align: center;
  display: none;
}

.location-box.capturing {
  display: block;
  border-color: var(--warning);
  background: rgba(245, 158, 11, 0.05);
}

.location-box.success {
  display: block;
  border-color: var(--success);
  background: rgba(16, 185, 129, 0.05);
}

.location-box.error {
  display: block;
  border-color: var(--error);
  background: rgba(239, 68, 68, 0.05);
}

.location-icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.location-status {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.location-accuracy {
  font-size: 1rem;
  font-weight: 600;
  color: var(--success);
  margin-bottom: 0.5rem;
}

.location-coords {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-family: 'Courier New', monospace;
  margin-bottom: 0.5rem;
}

.location-time {
  font-size: 0.6875rem;
  color: var(--text-tertiary);
  margin-bottom: 0.75rem;
}

.btn-recapture {
  background: var(--primary-500);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-md);
  padding: 0.625rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  min-height: 2.75rem;
}

.btn-recapture:hover {
  background: var(--primary-600);
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.location-box.capturing .location-icon {
  animation: pulse 1.5s ease-in-out infinite;
}

.permission-float {
  position: fixed;
  bottom: calc(56px + 1rem + env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  background: var(--surface);
  border: 2px solid var(--primary-500);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  padding: 0;
  min-width: 320px;
  max-width: 90vw;
  cursor: pointer;
  animation: pulse-permission 2s ease-in-out infinite;
}

.permission-float__content {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
}

.permission-float__icon {
  font-size: 1.5rem;
  color: var(--primary-500);
  flex-shrink: 0;
}

.permission-float__text {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex: 1;
}

.permission-float__text strong {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--text-primary);
}

.permission-float__text span {
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

.permission-float__btn {
  background: var(--primary-500);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.permission-float__btn:hover {
  background: var(--primary-600);
  transform: scale(1.05);
}

.permission-float__btn:active {
  transform: scale(0.95);
}

.permission-float {
  cursor: default;
}

.permission-float__btn {
  cursor: pointer;
}

.permission-float-old {
  position: fixed;
  top: 5rem;
  right: 1rem;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: var(--radius-full);
  border: none;
  background: var(--gradient-primary);
  color: #ffffff;
  box-shadow: var(--shadow-xl);
  cursor: pointer;
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  animation: pulse-permission 2s ease-in-out infinite;
}

.permission-float svg {
  width: 1.75rem;
  height: 1.75rem;
}

.permission-float:hover {
  transform: translateX(-50%) scale(1.05);
  box-shadow: var(--shadow-2xl);
}

.permission-float:active {
  transform: translateX(-50%) scale(0.95);
}

@keyframes pulse-permission {
  0%, 100% {
    box-shadow: var(--shadow-xl);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(34, 197, 94, 0.15), var(--shadow-xl);
  }
}

/* ========================================
   CONFIRMATIONS - Parentes
   ======================================== */

.confirmations-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin: 1.5rem 0;
}

.confirmation-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  position: relative;
}

.confirmation-complete-item {
  background: var(--surface);
  border: 2px solid var(--primary-400);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  position: relative;
  margin-bottom: 1.5rem;
}

.confirmation-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.confirmation-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-primary);
}

.btn-remove-confirmation {
  background: var(--error);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.5rem 1rem;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  min-height: 2.25rem;
}

.btn-remove-confirmation:hover {
  background: #dc2626;
  transform: translateY(-1px);
}

.btn-add-confirmation {
  width: 100%;
  background: var(--primary-500);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-md);
  padding: 1rem 1.5rem;
  font-size: 0.9375rem;
  text-align: center;
  cursor: pointer;
  font-weight: 600;
  min-height: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.625rem;
  box-shadow: var(--shadow-md);
  margin-bottom: 1.5rem;
  transition: all 0.2s ease;
}

.btn-add-confirmation:hover {
  background: var(--primary-600);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn-add-confirmation:active {
  transform: translateY(0);
}

.btn-capture-gps {
  background: var(--warning);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-md);
  padding: 0.75rem 1.25rem;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  min-height: 3rem;
  width: 100%;
  margin-top: 0.75rem;
  transition: all 0.2s ease;
}

.btn-capture-gps:hover {
  background: #f59e0b;
  transform: translateY(-1px);
}

.btn-capture-gps.capturing {
  background: #d97706;
  animation: pulse 1.5s ease-in-out infinite;
}

.btn-capture-gps.success {
  background: var(--success);
}

.gps-info {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid var(--success);
  border-radius: var(--radius-md);
  padding: 0.75rem;
  margin-top: 0.75rem;
  font-size: 0.8125rem;
  color: var(--text-primary);
  text-align: center;
}

/* Confirmation file uploads */
.conf-file-input {
  display: none !important;
}

.conf-upload-btn {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  background: var(--primary-500);
  color: white;
  padding: 0.625rem 1rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 600;
  transition: all 0.2s ease;
  border: none;
}

.conf-upload-btn:hover {
  background: var(--primary-600);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.conf-upload-btn:active {
  transform: translateY(0);
}

.conf-preview {
  display: flex !important;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.conf-count {
  font-weight: 700;
  color: var(--primary-600);
}

/* ========================================
   VIEWS - Lista de visitas
   ======================================== */

.view-wrapper {
  width: 100%;
  max-width: 48rem;
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-2xl);
  padding: 2rem;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.view-wrapper #hub-stats {
  display: grid !important;
  flex-shrink: 0;
}

.view-wrapper h2 {
  margin: 0;
  text-align: center;
  font-weight: 700;
}

.view-help {
  text-align: center;
  color: var(--text-secondary);
  margin: 0;
  font-size: 0.875rem;
}

.visit-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.visit-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: all 0.3s ease;
}

.visit-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
  border-color: var(--primary-300);
}

.visit-card__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
}

.visit-card__thumb-placeholder {
  width: 3.75rem;
  height: 3.75rem;
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-tertiary);
  flex-shrink: 0;
}

.visit-card__thumb-placeholder svg {
  width: 1.5rem;
  height: 1.5rem;
}

.visit-card__title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-primary);
}

.visit-card__meta {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  color: var(--text-secondary);
  font-size: 0.8125rem;
}

.visit-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.625rem;
}

.visit-card__actions button {
  flex: 1;
  min-width: 140px;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface-hover);
  color: var(--text-primary);
  font-size: 0.9375rem;
  font-weight: 600;
}

.visit-card__actions button:hover {
  background: var(--surface);
  border-color: var(--primary-400);
}

.visit-card__actions button.primary {
  border-color: var(--primary-500);
  background: var(--primary-500);
  color: #ffffff;
  box-shadow: var(--shadow);
}

.visit-card__actions button.primary:hover {
  background: var(--primary-600);
  border-color: var(--primary-600);
  box-shadow: var(--shadow-md);
}

.visit-card__actions button.danger {
  border-color: var(--error);
  background: rgba(239, 68, 68, 0.1);
  color: var(--error);
}

.visit-card__actions button.danger:hover {
  background: rgba(239, 68, 68, 0.2);
}

/* Hub Clock */
.hub-clock {
  text-align: center;
  padding: 1rem 0;
  margin-bottom: 1.5rem;
  color: var(--text-secondary);
  font-size: 0.9375rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.hub-clock-icon {
  font-size: 1.125rem;
}

.hub-clock-time {
  font-weight: 700;
  color: var(--text-primary);
  font-size: 1rem;
}

.hub-clock-separator {
  color: var(--border);
  opacity: 0.5;
}

.hub-clock-date {
  color: var(--text-secondary);
  text-transform: capitalize;
}

/* Hub Stats */
#hub-stats.hub-stats,
.hub-stats {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 1rem !important;
  margin: 0 auto 2rem auto !important;
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  align-items: stretch !important;
  justify-items: stretch !important;
}

#hub-stats.hub-stats > *,
.hub-stats > * {
  display: block !important;
  width: 100% !important;
}

#hub-stats .stat-card,
.hub-stats .stat-card,
.stat-card {
  background: var(--surface) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-xl) !important;
  padding: 1.5rem 1rem !important;
  text-align: center !important;
  box-shadow: var(--shadow) !important;
  transition: all 0.3s ease !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 0.75rem !important;
  box-sizing: border-box !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  margin: 0 !important;
  flex: 1 1 auto !important;
}

.stat-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
  border-color: var(--primary-300);
}

.stat-icon {
  font-size: 2.5rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stat-icon i {
  font-size: inherit;
}

.stat-icon-draft {
  color: #f97316;
}

.stat-icon-saved {
  color: #22c55e;
}

.stat-icon-sent {
  color: #3b82f6;
}

.stat-number {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
}

.stat-label {
  font-size: 0.875rem;
  color: var(--text-secondary);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Visit Card Active */
.visit-card-active {
  margin-top: 0;
}

.visit-card-active .visit-card__header {
  margin-bottom: 0.5rem;
}

.visit-card-active .visit-card__icon {
  font-size: 1.5rem;
  margin-bottom: 0.25rem;
}

.visit-card-active .visit-card__title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.visit-card-active .visit-card__content {
  padding: 1rem 0;
}

.visit-card-active .visit-card__info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.visit-card-active .visit-card__client-icon {
  font-size: 1.25rem;
}

.visit-card-active .visit-card__client-name {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-primary);
}

.visit-card-active .visit-card__meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.visit-card-active .visit-card__time {
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

.visit-card-active .visit-card__actions {
  margin-top: 0.5rem;
}

.visit-card-active .btn-primary {
  width: 100%;
  padding: 0.875rem 1.25rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: none;
  background: var(--primary-500);
  color: #fff;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: all 0.2s ease;
}

.visit-card-active .btn-primary:hover {
  background: var(--primary-600);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

@media (max-width: 640px) {
  #hub-stats.hub-stats,
  .hub-stats {
    grid-template-columns: 1fr !important;
    gap: 0.875rem !important;
  }
  
  .hub-clock {
    font-size: 0.875rem;
    gap: 0.375rem;
  }
  
  .hub-clock-separator {
    display: none;
  }
  
  .stat-card {
    padding: 1.25rem 0.875rem;
    width: 100% !important;
  }
  
  .stat-number {
    font-size: 2rem;
  }
  
  .stat-icon {
    font-size: 2rem;
  }
}

.icon-delete {
  border: 0;
  background: transparent;
  color: var(--error);
  width: 1.75rem;
  height: 1.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  z-index: 10;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
}

.icon-delete:hover {
  background: rgba(239, 68, 68, 0.1);
  transform: scale(1.1);
}

.icon-delete:active {
  transform: scale(0.9);
}

.icon-delete svg {
  width: 1.125rem !important;
  height: 1.125rem !important;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}

/* ========================================
   FOOTER - Save Draft Button
   ======================================== */

/* ========================================
   BOTTOM TABS NAVIGATION
   ======================================== */

.bottom-tabs {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-around;
  align-items: center;
  background: var(--surface);
  border-top: 1px solid var(--border);
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
  padding: 0.5rem;
  padding-bottom: max(0.5rem, env(safe-area-inset-bottom));
  z-index: 120;
  backdrop-filter: blur(10px);
}

.bottom-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  padding: 0.5rem;
  background: transparent;
  border: none;
  color: var(--text-tertiary);
  font-size: 0.625rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  border-radius: var(--radius-md);
  min-height: 56px;
}

.bottom-tab i {
  font-size: 1.25rem;
  transition: all 0.2s ease;
}

.bottom-tab:hover {
  background: var(--surface-hover);
  color: var(--text-secondary);
}

.bottom-tab.active {
  color: var(--primary-600);
  background: var(--primary-50);
}

.bottom-tab.active i {
  color: var(--primary-600);
}

/* Floating Action Button for Save Draft */
.btn-save-draft-fab {
  display: none;
  position: fixed;
  bottom: calc(56px + 1rem + env(safe-area-inset-bottom));
  right: 1rem;
  width: 56px;
  height: 56px;
  background: var(--primary-500);
  color: #fff;
  border: none;
  border-radius: 50%;
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-xl);
  transition: all 0.2s ease;
  z-index: 110;
  cursor: pointer;
}

.btn-save-draft-fab:hover {
  transform: scale(1.1);
  background: var(--primary-600);
  box-shadow: var(--shadow-2xl);
}

.btn-save-draft-fab:active {
  transform: scale(0.95);
}

/* Mostrar botões apenas quando form-view está ativo - via JS */
.btn-save-draft-fab {
  display: none;
}

/* Edit Button (similar ao save draft, mas acima) */
.btn-edit-fab {
  position: fixed;
  bottom: calc(56px + 1rem + 60px + env(safe-area-inset-bottom));
  right: 1rem;
  width: 56px;
  height: 56px;
  background: var(--warning);
  color: #fff;
  border: none;
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-xl);
  z-index: 110;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  transition: all 0.2s ease;
  cursor: pointer;
}

.btn-edit-fab:hover {
  transform: scale(1.1);
  background: #d97706;
  box-shadow: var(--shadow-2xl);
}

.btn-edit-fab:active {
  transform: scale(0.95);
}

.btn-save-draft:hover {
  background: var(--primary-600);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn-save-draft svg {
  width: 1rem !important;
  height: 1rem !important;
  fill: none !important;
  stroke: currentColor !important;
  stroke-width: 2 !important;
  display: block !important;
}

/* ========================================
   SECTIONS
   ======================================== */

.section {
  display: none;
}

.section.active {
  display: block;
}

/* ========================================
   PROGRESS INDICATOR
   ======================================== */

.progress-steps {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  margin: 2rem 0;
  padding: 0 2rem;
  gap: 0.5rem;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow-x: auto;
  overflow-y: visible;
  scrollbar-width: none;
  -ms-overflow-style: none;
  scroll-padding: 2rem;
}

.progress-steps::-webkit-scrollbar {
  display: none;
}

.progress-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  flex: 0 0 auto;
  position: relative;
  min-width: fit-content;
  flex-shrink: 0;
  scroll-snap-align: start;
}

.progress-step-circle {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--bg-secondary);
  border: 3px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: all 0.3s ease;
}

.progress-step-number {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-tertiary);
  transition: all 0.3s ease;
}

.progress-step-check {
  position: absolute;
  font-size: 1.25rem;
  color: white;
  opacity: 0;
  transform: scale(0.5);
  transition: all 0.3s ease;
}

.progress-step-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-tertiary);
  text-align: center;
  white-space: nowrap;
  transition: all 0.3s ease;
}

.progress-line {
  flex: 1;
  min-width: 30px;
  max-width: 80px;
  height: 3px;
  background: var(--border);
  border-radius: var(--radius-full);
  transition: all 0.3s ease;
}

/* Step states */
.progress-step.active .progress-step-circle {
  background: var(--gradient-primary);
  border-color: var(--primary-500);
  box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.15);
}

.progress-step.active .progress-step-number {
  color: white;
}

.progress-step.active .progress-step-label {
  color: var(--primary-600);
}

.progress-step.completed .progress-step-circle {
  background: var(--success);
  border-color: var(--success);
}

.progress-step.completed .progress-step-number {
  opacity: 0;
  transform: scale(0.5);
}

.progress-step.completed .progress-step-check {
  opacity: 1;
  transform: scale(1);
}

.progress-step.completed .progress-step-label {
  color: var(--success);
}

.progress-step.completed + .progress-line {
  background: var(--success);
}

/* Mobile adjustments */
@media (max-width: 640px) {
  .progress-steps {
    gap: 0.25rem;
    padding: 0 0.5rem;
  }

  .progress-step-circle {
    width: 40px;
    height: 40px;
  }

  .progress-step-number {
    font-size: 1rem;
  }

  .progress-step-label {
    font-size: 0.625rem;
  }

  .progress-line {
    min-width: 15px;
    max-width: 30px;
  }
}

/* ========================================
   UTILITIES
   ======================================== */

.hidden {
  display: none !important;
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 768px) {
  .topbar {
    padding: 0.75rem 1rem;
    gap: 0.5rem;
  }

  .brand > span {
    font-size: 1rem;
  }

  h1 {
    font-size: 1.75rem;
  }

  .card {
    padding: 1.5rem;
  }

  .modal-content,
  .cep-modal-content {
    padding: 1.5rem;
  }

  .view-wrapper {
    padding: 1.5rem;
  }

  .footer-bar {
    padding: 0.75rem 0;
  }

  #main-content {
    padding-bottom: 5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ========================================
   MODAL DE RESUMO DA VISITA
   ======================================== */

.btn-view-summary {
  background: var(--primary-500);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.btn-view-summary:hover {
  background: var(--primary-600);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-view-summary:active {
  transform: translateY(0);
}

.summary-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.summary-modal__overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(4px);
  animation: fadeIn 0.3s ease;
}

.summary-modal__content {
  position: relative;
  background: var(--surface);
  width: 95%;
  height: 95vh;
  max-width: 1000px;
  border-radius: var(--radius-xl);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-2xl);
  animation: slideUpScale 0.4s ease-out;
  z-index: 10001;
}

.summary-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem 2rem;
  border-bottom: 2px solid var(--border);
  background: var(--gradient-primary);
  flex-shrink: 0;
}

.summary-modal__title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
  margin: 0;
}

.summary-modal__close {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #fff;
  font-size: 1.25rem;
  transition: all 0.2s ease;
}

.summary-modal__close:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: rotate(90deg);
}

.summary-modal__body {
  flex: 1;
  overflow-y: auto;
  padding: 2rem;
  background: var(--background);
}

.summary-modal__footer {
  padding: 1.5rem 2rem;
  border-top: 2px solid var(--border);
  background: var(--surface);
  display: flex;
  justify-content: center;
  flex-shrink: 0;
}

.btn-close-summary {
  background: var(--primary-500);
  color: #fff;
  border: none;
  border-radius: var(--radius-lg);
  padding: 0.875rem 2.5rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-close-summary:hover {
  background: var(--primary-600);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn-close-summary:active {
  transform: translateY(0);
}

/* Seções do resumo */
.summary-section {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  border: 1px solid var(--border);
}

.summary-section__title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary-500);
  margin: 0 0 1rem 0;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--primary-100);
}

.summary-section__title i {
  font-size: 1.5rem;
}

.summary-field {
  margin-bottom: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.summary-field:last-child {
  margin-bottom: 0;
}

.summary-field__label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.summary-field__value {
  font-size: 1.125rem;
  font-weight: 500;
  color: var(--text-primary);
  word-break: break-word;
}

.summary-field__value--highlight {
  color: var(--primary-500);
  font-weight: 700;
}

.summary-field__value--link {
  color: var(--primary-500);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
}

.summary-field__value--link:hover {
  color: var(--primary-600);
  text-decoration: underline;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
}

.summary-photos {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.summary-photo {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  aspect-ratio: 1;
  background: var(--background);
  border: 2px solid var(--border);
}

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

.summary-photo__label {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
  color: #fff;
  padding: 0.75rem;
  font-size: 0.875rem;
  font-weight: 600;
  text-align: center;
}

.summary-confirmations {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1rem;
}

.summary-confirmation {
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem;
}

.summary-confirmation__name {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.summary-confirmation__fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.75rem;
}

.summary-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-full);
  font-size: 0.875rem;
  font-weight: 600;
  background: var(--success-light);
  color: var(--success);
  border: 1px solid var(--success);
}

.summary-badge--warning {
  background: var(--warning-light);
  color: var(--warning);
  border-color: var(--warning);
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideUpScale {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Container do Mapa */
.summary-map-container {
  margin-top: 1.5rem;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 2px solid var(--border);
  box-shadow: var(--shadow-md);
}

.summary-map-header {
  background: var(--gradient-primary);
  padding: 0.875rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.summary-map-header span {
  color: #fff;
  font-weight: 600;
  font-size: 0.9375rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.summary-map-header span i {
  font-size: 1.125rem;
}

.summary-map-link {
  color: #fff;
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0.5rem 1rem;
  background: rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
}

.summary-map-link:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: translateY(-2px);
}

.summary-map-iframe {
  width: 100%;
  height: 350px;
  border: none;
  display: block;
  background: var(--background);
}

/* Responsivo */
@media (max-width: 768px) {
  .summary-modal__content {
    width: 100%;
    height: 100vh;
    border-radius: 0;
  }

  .summary-modal__header,
  .summary-modal__footer {
    padding: 1rem 1.5rem;
  }

  .summary-modal__body {
    padding: 1rem;
  }

  .summary-section {
    padding: 1rem;
  }

  .summary-grid,
  .summary-photos {
    grid-template-columns: 1fr;
  }

  .summary-confirmation__fields {
    grid-template-columns: 1fr;
  }

  .summary-modal__title {
    font-size: 1.125rem;
  }

  .summary-map-header {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
    padding: 1rem;
  }

  .summary-map-header span {
    font-size: 0.875rem;
  }

  .summary-map-link {
    justify-content: center;
    font-size: 0.8125rem;
  }

  .summary-map-iframe {
    height: 280px;
  }
}
