:root {
  --space-1: 8px;
  --space-2: 12px;
  --space-3: 16px;
  --space-4: 24px;
  --space-5: 32px;

  --color-bg: #0f172a;
  --color-card: #111827;
  --color-text: #e5e7eb;
  --color-muted: #94a3b8;

  --color-primary: #2563eb;
  --color-secondary: #059669;
  --color-tertiary: #6b7280;
  --color-danger: #dc2626;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-3);
  background: #0b1220;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  gap: var(--space-3);
}

.app-header img {
  max-width: 420px;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 4px 16px rgba(0,0,0,0.3));
  margin: 0 auto;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

/* ===== BOTÃO DE NOTIFICAÇÕES ===== */
.notifications-container {
  position: relative;
}

.btn-notifications {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  background: rgba(107, 114, 128, 0.2);
  color: var(--color-muted);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 44px;
  min-height: 44px;
}

.btn-notifications:hover {
  background: rgba(107, 114, 128, 0.3);
  border-color: rgba(255, 255, 255, 0.2);
  color: var(--color-text);
}

.btn-notifications.has-notifications {
  background: rgba(220, 38, 38, 0.2);
  color: #fca5a5;
  border-color: rgba(220, 38, 38, 0.4);
  animation: pulse-notification 2s ease-in-out infinite;
}

.btn-notifications.has-notifications:hover {
  background: rgba(220, 38, 38, 0.3);
  border-color: rgba(220, 38, 38, 0.6);
  color: #fee2e2;
}

@keyframes pulse-notification {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.4);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(220, 38, 38, 0);
  }
}

.btn-notifications svg {
  flex-shrink: 0;
}

.notification-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  background: var(--color-danger);
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 5px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
  line-height: 1;
}

/* ===== DROPDOWN DE NOTIFICAÇÕES ===== */
.notifications-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 360px;
  max-width: 90vw;
  background: var(--color-card);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-10px);
  transition: all 0.2s ease;
}

.notifications-dropdown.show {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.notifications-header {
  padding: var(--space-3);
  border-bottom: 1px solid rgba(255,255,255,0.1);
  background: rgba(220, 38, 38, 0.1);
}

.notifications-header h3 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: #fca5a5;
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.notifications-header h3::before {
  content: "⚠️";
  font-size: 1.1rem;
}

.notifications-list {
  max-height: 400px;
  overflow-y: auto;
  padding: var(--space-2);
}

.notifications-empty {
  padding: var(--space-4);
  text-align: center;
  color: var(--color-muted);
  font-size: 0.9rem;
  margin: 0;
}

.notification-item {
  padding: var(--space-3);
  margin-bottom: var(--space-2);
  background: rgba(220, 38, 38, 0.1);
  border: 1px solid rgba(220, 38, 38, 0.2);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.notification-item:last-child {
  margin-bottom: 0;
}

.notification-item:hover {
  background: rgba(220, 38, 38, 0.15);
  border-color: rgba(220, 38, 38, 0.3);
  transform: translateX(2px);
}

.notification-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-1);
}

.notification-numero {
  font-weight: 700;
  color: var(--color-danger);
  font-size: 0.95rem;
}

.notification-cliente {
  font-size: 0.9rem;
  color: var(--color-text);
  font-weight: 600;
  margin-bottom: 4px;
}

.notification-local {
  font-size: 0.85rem;
  color: var(--color-muted);
  line-height: 1.4;
}

.btn-logout {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: rgba(220, 38, 38, 0.1);
  color: #fca5a5;
  border: 1px solid rgba(220, 38, 38, 0.3);
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-logout:hover {
  background: rgba(220, 38, 38, 0.2);
  border-color: rgba(220, 38, 38, 0.5);
  color: #fee2e2;
}

.btn-logout svg {
  flex-shrink: 0;
}

@media (max-width: 768px) {
  .app-header {
    flex-direction: column;
    gap: var(--space-2);
  }
  
  .header-actions {
    width: 100%;
    justify-content: space-between;
  }
  
  /* Botão Sair - apenas ícone em mobile */
  .btn-logout {
    padding: 10px;
    min-width: 44px;
    font-size: 0; /* Esconde o texto */
    gap: 0;
  }
  
  .btn-logout svg {
    /* Mantém o tamanho do ícone */
    width: 20px;
    height: 20px;
  }
  
  /* Dropdown centralizado e fixo na tela em mobile */
  .notifications-dropdown {
    position: fixed;
    top: auto;
    bottom: 20px;
    left: 50%;
    right: auto;
    width: calc(100vw - 32px);
    max-width: 360px;
    transform: translateX(-50%) translateY(20px);
    max-height: 60vh;
  }
  
  .notifications-dropdown.show {
    transform: translateX(-50%) translateY(0);
  }
  
  .notifications-list {
    max-height: calc(60vh - 60px);
  }
}

main {
  padding: var(--space-4);
  max-width: 980px;
  margin: 0 auto;
}

.grid-buttons {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-4);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-5) var(--space-4);
  font-size: 1.25rem;
  font-weight: 700;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  color: white;
  transition: transform 0.06s ease, filter 0.15s ease, opacity 0.2s ease;
}

.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary { background: var(--color-primary); }
.btn-secondary { background: var(--color-secondary); }
.btn-tertiary { background: var(--color-tertiary); }
.btn-danger { background: var(--color-danger); }
.btn-cancel { background: var(--color-danger); }
.btn-save { background: var(--color-secondary); }

/* Badge no botão */
.btn-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 8px;
  margin-left: 8px;
  background: white;
  color: var(--color-danger);
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 700;
  line-height: 1;
}

.view { display: none; }
.view.active { display: block; }

h2 { margin-top: 0; }

fieldset {
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  padding: var(--space-4);
  margin-bottom: var(--space-4);
  background: var(--color-card);
}

legend { color: var(--color-muted); padding: 0 var(--space-2); }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: var(--space-3); }

/* Lista de ficheiros selecionados */
.ficheiros-lista {
  margin-top: var(--space-3);
  padding: var(--space-3);
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.ficheiros-lista-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-2);
}

.ficheiros-lista-header strong {
  color: var(--color-text);
  font-size: 0.9rem;
}

.btn-link {
  background: none;
  border: none;
  color: var(--color-primary);
  text-decoration: underline;
  cursor: pointer;
  font-size: 0.85rem;
  padding: 0;
  transition: color 0.2s;
}

.btn-link:hover {
  color: #3b82f6;
}

.btn-limpar-ficheiros {
  color: var(--color-danger);
}

.btn-limpar-ficheiros:hover {
  color: #ef4444;
}

#lista-ficheiros {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ficheiro-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: var(--color-card);
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: background 0.2s;
}

.ficheiro-item:hover {
  background: rgba(37, 99, 235, 0.05);
}

.ficheiro-info {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.ficheiro-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
}

.ficheiro-detalhes {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.ficheiro-nome {
  color: var(--color-text);
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ficheiro-tamanho {
  color: var(--color-muted);
  font-size: 0.8rem;
}

.btn-remover-ficheiro {
  background: transparent;
  border: 1px solid rgba(220, 38, 38, 0.3);
  color: var(--color-danger);
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.8rem;
  transition: all 0.2s;
  flex-shrink: 0;
}

.btn-remover-ficheiro:hover {
  background: var(--color-danger);
  color: white;
  border-color: var(--color-danger);
}
.row-inline { display: flex; gap: var(--space-3); align-items: center; flex-wrap: wrap; }

label { font-weight: 600; }

input[type="text"], input[type="tel"], input[type="email"], input[type="date"], input[type="time"], select, textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.12);
  background: #0b1020;
  color: var(--color-text);
  font-size: 16px; /* evita zoom no iOS */
  box-sizing: border-box;
  -webkit-appearance: none; /* Remove estilo nativo do iOS */
  appearance: none; /* Propriedade padrão para compatibilidade */
  -webkit-tap-highlight-color: transparent; /* Remove highlight azul no touch */
}

textarea { 
  min-height: 88px; 
  resize: vertical; 
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
}

.form-actions { display: flex; gap: var(--space-3); justify-content: flex-end; margin-top: var(--space-4); }

.view-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  gap: var(--space-3);
}

.view-header h2 {
  margin: 0;
  flex-grow: 1;
}

.btn-voltar-menu {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  font-size: 0.9rem;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  color: white;
  background: var(--color-secondary);
  transition: transform 0.06s ease, filter 0.15s ease, opacity 0.2s ease;
  white-space: nowrap;
  flex-shrink: 0;
}

.btn-voltar-menu:hover {
  filter: brightness(1.1);
}

.btn-voltar-menu:active {
  transform: scale(0.98);
}

.hidden { display: none !important; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  background: rgba(17,24,39,0.95);
  color: white;
  border: 1px solid rgba(255,255,255,0.12);
  padding: 10px 14px;
  border-radius: 10px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(-4px); }

.search-form { margin-bottom: var(--space-4); }
.grid-filters { 
  display: grid; 
  grid-template-columns: 1fr 1fr 1fr;
  grid-template-rows: auto auto;
  gap: var(--space-3); 
}
 
.grid-filters .field:nth-child(4) {
  grid-column: 1;
  grid-row: 2;
}
 
.grid-filters .field:nth-child(5) {
  grid-column: 2;
  grid-row: 2;
}

.results { overflow: auto; border: 1px solid rgba(255,255,255,0.12); border-radius: 10px; background: var(--color-card); }
table { width: 100%; border-collapse: collapse; min-width: 800px; }
thead th { position: sticky; top: 0; background: #0f172a; text-align: left; padding: 10px; font-weight: 700; border-bottom: 1px solid rgba(255,255,255,0.1); white-space: nowrap; }
tbody td { padding: 10px; border-bottom: 1px solid rgba(255,255,255,0.06); white-space: nowrap; }
tbody tr { cursor: pointer; }
tbody tr:hover { background: rgba(255,255,255,0.04); }

/* Linhas de serviços vencidos (Confirmado e já passou da data/hora fim) */
tbody tr.servico-vencido {
  background: #ef4444 !important;
  color: #ffffff;
  font-weight: 500;
}

tbody tr.servico-vencido:hover {
  background: #dc2626 !important;
}

tbody tr.servico-vencido td {
  border-bottom-color: rgba(220, 38, 38, 0.3);
}
 
/* Estilos específicos para colunas */
table th:nth-child(6), table td:nth-child(6) { /* Especialidade */
  min-width: 120px;
}
table th:nth-child(7), table td:nth-child(7) { /* Tipo de Serviço */
  min-width: 150px;
}

.servico-detalhes {
  background: var(--color-card);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  padding: var(--space-4);
  margin-top: var(--space-3);
}

.servico-detalhes h3 {
  margin: 0 0 var(--space-3) 0;
  font-size: 1.125rem;
  color: var(--color-text);
  font-weight: 600;
}

.detalhes-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-3);
}

.detalhe-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.detalhe-label {
  font-size: 0.875rem;
  color: var(--color-muted);
  font-weight: 500;
}

.detalhe-valor {
  font-size: 1rem;
  color: var(--color-text);
  word-wrap: break-word;
  white-space: pre-wrap;
}

@media (max-width: 768px) {
  .detalhes-grid {
    grid-template-columns: 1fr;
  }
}

.row-actions { position: sticky; bottom: 0; display: flex; gap: var(--space-3); align-items: center; justify-content: space-between; background: #0b1220; border: 1px solid rgba(255,255,255,0.12); padding: var(--space-3); border-radius: 10px; margin-top: var(--space-3); }

.row-actions .btn-action {
  padding: 10px 16px !important;
  font-size: 0.9rem !important;
  font-weight: 600 !important;
  min-height: 40px;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.row-actions .btn-action span {
  line-height: 1;
}

@media (max-width: 768px) {
  .grid-filters { 
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto auto;
  }
  
  .grid-filters .field:nth-child(4) {
    grid-column: 1;
    grid-row: 3;
  }
  
  .grid-filters .field:nth-child(5) {
    grid-column: 2;
    grid-row: 3;
  }
}

/* Estilos para campos com erro */
.field-error input, 
.field-error textarea, 
.field-error select {
  border-color: var(--color-danger) !important;
  background-color: rgba(220, 38, 38, 0.1) !important;
  box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.2);
}

.field-error label {
  color: var(--color-danger) !important;
}

.error-message {
  color: var(--color-danger);
  font-size: 0.875rem;
  margin-top: 4px;
  font-weight: 500;
}

/* Estilos para Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal.show {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  background: var(--color-card);
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.12);
  width: 90%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.9);
  transition: transform 0.3s ease;
}

.modal.show .modal-content { transform: scale(1); }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4);
  border-bottom: 1px solid rgba(255,255,255,0.12);
}

.modal-header h3 { margin: 0; color: var(--color-text); }

.modal-close {
  background: none;
  border: none;
  color: var(--color-muted);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background-color 0.2s ease;
}

.modal-close:hover { background: rgba(255,255,255,0.1); color: var(--color-text); }

.modal-body { padding: var(--space-4); }

.modal-actions { display: flex; gap: var(--space-3); justify-content: flex-end; margin-top: var(--space-4); }

@media (max-width: 640px) {
  .grid-buttons { grid-template-columns: 1fr; }
  .btn { font-size: 1.1rem; padding: var(--space-4) var(--space-3); }
  main { padding: var(--space-3); }
  .grid-filters { 
    grid-template-columns: 1fr;
    grid-template-rows: repeat(5, auto);
  }
  
  .grid-filters .field:nth-child(4),
  .grid-filters .field:nth-child(5) {
    grid-column: 1;
    grid-row: auto;
  }
}

/* iOS Safari */
@supports (-webkit-touch-callout: none) {
  html {
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
  }
  body { -webkit-overflow-scrolling: touch; }
  input, select, textarea { font-size: 16px !important; }
  .btn {
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
  }
}

/* Toast color variants inserted dynamically by JS */
.toast.success { background: rgba(5, 150, 105, 0.9); border-color: #059669; }
.toast.error { background: rgba(220, 38, 38, 0.9); border-color: #dc2626; }
.toast.info { background: rgba(37, 99, 235, 0.9); border-color: #2563eb; }

/* Estilos para campo de input com botão */
.input-with-button {
  display: flex;
  align-items: stretch;
  gap: 0;
}

.input-with-button input {
  flex: 1;
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
  margin: 0;
}

.btn-search {
  padding: 12px 14px;
  border: 1px solid rgba(255,255,255,0.12);
  border-left: none;
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  border-top-right-radius: 10px;
  border-bottom-right-radius: 10px;
  background: var(--color-primary);
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s ease, transform 0.06s ease;
  -webkit-tap-highlight-color: transparent;
}

.btn-search:hover {
  background: #1d4ed8;
}

.btn-search:active {
  transform: scale(0.98);
}

.btn-search svg {
  width: 16px;
  height: 16px;
}

/* Estilos para modal grande */
.modal-large {
  width: 95%;
  max-width: 700px;
}

/* Estilos para estados de carregamento e erro */
.loading-state, .error-state {
  text-align: center;
  padding: var(--space-4);
}

.loading-state p, .error-state p {
  color: var(--color-muted);
  margin-bottom: var(--space-3);
}

/* Estilos para filtro de pesquisa de clientes */
.search-client-filter {
  margin-bottom: var(--space-3);
}

.search-client-filter input {
  width: 100%;
  margin: 0;
}

/* Container da tabela de clientes */
.clientes-table-container {
  max-height: 400px;
  overflow-y: auto;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  background: var(--color-card);
}

/* Estilos específicos para a tabela de clientes */
#tbl-clientes {
  margin: 0;
}

#tbl-clientes thead th {
  background: var(--color-bg);
  border-bottom: 1px solid rgba(255,255,255,0.12);
  position: sticky;
  top: 0;
  z-index: 1;
}

#tbl-clientes tbody tr {
  cursor: pointer;
  transition: background-color 0.2s ease;
}

#tbl-clientes tbody tr:hover {
  background: rgba(37, 99, 235, 0.1);
}

#tbl-clientes tbody tr.selected {
  background: rgba(37, 99, 235, 0.2) !important;
}

#tbl-clientes tbody td {
  padding: 12px 10px;
  white-space: nowrap;
}

/* Estilos para dropdown de sugestões */
.dropdown-container {
  position: relative;
}

.suggestions-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--color-card);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
  z-index: 100;
  max-height: 300px;
  overflow-y: auto;
  margin-top: 4px;
}

.suggestions-header {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  background: rgba(255,255,255,0.02);
  border-top-left-radius: 10px;
  border-top-right-radius: 10px;
}

.suggestions-header span {
  font-size: 0.875rem;
  color: var(--color-muted);
  font-weight: 600;
}

.suggestions-list {
  max-height: 250px;
  overflow-y: auto;
}

.suggestion-item {
  padding: 12px 14px;
  cursor: pointer;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  transition: background-color 0.2s ease;
  font-size: 0.95rem;
  line-height: 1.4;
}

.suggestion-item:last-child {
  border-bottom: none;
  border-bottom-left-radius: 10px;
  border-bottom-right-radius: 10px;
}

.suggestion-item:hover {
  background: rgba(37, 99, 235, 0.1);
}

.suggestion-item:active {
  background: rgba(37, 99, 235, 0.2);
}

.suggestions-empty {
  padding: 16px 14px;
  text-align: center;
  color: var(--color-muted);
  font-style: italic;
  font-size: 0.9rem;
}

/* Responsive para o input com botão */
@media (max-width: 640px) {
  .btn-search {
    padding: 10px 12px;
  }
  
  .modal-large {
    width: 98%;
    max-width: none;
  }
  
  .clientes-table-container {
    max-height: 300px;
  }
  
  .suggestions-dropdown {
    max-height: 200px;
  }
  
  .suggestions-list {
    max-height: 150px;
  }
}

/* ===== ESTILOS PARA SISTEMA DE RELATÓRIOS ===== */

/* Informações do Serviço */
.servico-info {
  background: var(--color-card);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  padding: var(--space-4);
  margin-bottom: var(--space-4);
}

.servico-info h3 {
  margin: 0 0 var(--space-3) 0;
  color: var(--color-text);
  font-size: 1.1rem;
}

.servico-details {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-2);
}

/* Informação do Sistema */
.info-sistema-section {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.1) 0%, rgba(5, 150, 105, 0.1) 100%);
  border: 1px solid rgba(37, 99, 235, 0.3);
  border-radius: 10px;
  padding: var(--space-4);
  margin-bottom: var(--space-4);
}

.info-sistema-section h3 {
  margin: 0 0 var(--space-3) 0;
  color: var(--color-text);
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.info-sistema-section h3::before {
  content: "⚙️";
  font-size: 1.2rem;
}

.info-sistema-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--space-3);
}

.campo-obrigatorio {
  color: #f87171;
  font-weight: bold;
}

.servico-details span {
  color: var(--color-muted);
  font-size: 0.9rem;
}

/* Container de Verificações */
.verificacoes-container {
  background: var(--color-card);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  padding: var(--space-4);
  margin-bottom: var(--space-4);
}

.verificacoes-container h3 {
  margin: 0 0 var(--space-4) 0;
  color: var(--color-text);
  font-size: 1.1rem;
}

/* Tabela de Verificações */
.verificacoes-table-container {
  overflow-x: auto;
  margin-bottom: var(--space-4);
}

.verificacoes-table {
  width: 100%;
  border-collapse: collapse;
  background: rgba(0,0,0,0.2);
  border-radius: 8px;
  overflow: hidden;
}

.verificacoes-table th {
  background: rgba(37, 99, 235, 0.1);
  color: var(--color-text);
  padding: var(--space-3);
  text-align: left;
  font-weight: 600;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.verificacoes-table td {
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid rgba(255,255,255,0.05);
  vertical-align: middle;
}

.verificacoes-table tbody tr:last-child td {
  border-bottom: none;
}

.verificacoes-table tbody tr:hover {
  background: rgba(255,255,255,0.02);
}

/* Radio buttons nas verificações */
.verificacao-radio {
  text-align: center;
  width: 80px;
}

.verificacao-radio input[type="radio"] {
  transform: scale(1.2);
  accent-color: var(--color-primary);
}

/* Botão de observações opcionais */
.btn-obs-opcional {
  margin-left: 8px;
  padding: 4px 8px;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.2s ease;
  color: var(--color-text);
}

.btn-obs-opcional:hover {
  background: rgba(16, 185, 129, 0.25);
  border-color: rgba(16, 185, 129, 0.5);
}

.btn-obs-opcional.hidden {
  display: none;
}

/* Linha de observações de Bom Funcionamento */
.observacoes-bom-func-row {
  background: rgba(16, 185, 129, 0.05);
  border-top: 1px solid rgba(16, 185, 129, 0.2);
  transition: all 0.3s ease;
  opacity: 1;
  transform: scaleY(1);
  transform-origin: top;
}

.observacoes-bom-func-row.hidden {
  opacity: 0;
  transform: scaleY(0);
  max-height: 0;
  overflow: hidden;
}

.observacoes-bom-func-row td {
  padding: var(--space-3) !important;
  border-bottom: 1px solid rgba(255,255,255,0.05) !important;
  transition: padding 0.3s ease;
}

.observacoes-bom-func-row.hidden td {
  padding: 0 var(--space-3) !important;
}

/* Linha de observações dinâmica */
.observacoes-row {
  background: rgba(37, 99, 235, 0.05);
  border-top: 1px solid rgba(37, 99, 235, 0.2);
  transition: all 0.3s ease;
  opacity: 1;
  transform: scaleY(1);
  transform-origin: top;
}

.observacoes-row.hidden {
  opacity: 0;
  transform: scaleY(0);
  max-height: 0;
  overflow: hidden;
}

.observacoes-row td {
  padding: var(--space-3) !important;
  border-bottom: 1px solid rgba(255,255,255,0.05) !important;
  transition: padding 0.3s ease;
}

.observacoes-row.hidden td {
  padding: 0 var(--space-3) !important;
}

.observacoes-container {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.observacoes-label {
  font-weight: 600;
  color: var(--color-primary);
  font-size: 0.9rem;
  margin-bottom: var(--space-1);
}

/* Campo de observações */
.observacoes-input {
  width: 100%;
  padding: var(--space-3);
  background: rgba(0,0,0,0.3);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 6px;
  color: var(--color-text);
  font-size: 0.9rem;
  resize: vertical;
  min-height: 80px;
  font-family: inherit;
  line-height: 1.4;
}

.observacoes-input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.observacoes-input::placeholder {
  color: var(--color-muted);
  opacity: 0.7;
}

/* Ações das verificações */
.verificacoes-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-3);
}

/* Container de Confirmação */
.confirmacao-container {
  background: var(--color-card);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  padding: var(--space-4);
}

.confirmacao-container h3 {
  margin: 0 0 var(--space-4) 0;
  color: var(--color-text);
  font-size: 1.1rem;
}

/* Resumo das Verificações */
.resumo-verificacoes {
  margin-bottom: var(--space-5);
}

.resumo-verificacoes h4 {
  margin: 0 0 var(--space-3) 0;
  color: var(--color-text);
  font-size: 1rem;
}

#resumo-content {
  background: rgba(0,0,0,0.2);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  padding: var(--space-3);
  color: var(--color-muted);
}

.resumo-item {
  margin-bottom: var(--space-2);
  padding-bottom: var(--space-2);
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.resumo-item:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.resumo-item strong {
  color: var(--color-text);
}

.resumo-observacao {
  font-style: italic;
  color: var(--color-muted);
  margin-top: var(--space-1);
}

/* === ESTILOS PARA INFO MATERIAL === */

/* Container principal do Info Material */
.info-material-container {
  background: rgba(0,0,0,0.2);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  padding: var(--space-4);
  margin-top: var(--space-2);
}

/* Cabeçalho do Info Material */
.info-material-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-3);
  gap: var(--space-3);
}

.info-material-header h4 {
  margin: 0;
  color: var(--color-text);
  font-size: 1.1rem;
  flex: 1;
}

.btn-adicionar-material {
  background: var(--color-primary);
  color: white;
  border: none;
  padding: var(--space-2) var(--space-3);
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.btn-adicionar-material:hover {
  background: var(--color-primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(37, 99, 235, 0.3);
}

.btn-adicionar-material span {
  font-size: 1rem;
  font-weight: bold;
}

/* Container da tabela de materiais */
.materiais-table-container {
  overflow-x: auto;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.1);
}

/* Tabela de materiais */
.materiais-table {
  width: 100%;
  border-collapse: collapse;
  background: rgba(0,0,0,0.3);
}

.materiais-table th {
  background: rgba(255,255,255,0.1);
  color: var(--color-text);
  font-weight: 600;
  padding: var(--space-2) var(--space-1);
  text-align: left;
  font-size: 0.85rem;
  border-bottom: 1px solid rgba(255,255,255,0.2);
}

.materiais-table td {
  padding: var(--space-1);
  border-bottom: 1px solid rgba(255,255,255,0.05);
  vertical-align: top;
}

.materiais-table tr:last-child td {
  border-bottom: none;
}

/* Campos de input na tabela */
.materiais-table input[type="text"],
.materiais-table input[type="number"] {
  width: 100%;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 4px;
  padding: var(--space-1);
  color: var(--color-text);
  font-size: 0.85rem;
  transition: all 0.2s ease;
}

.materiais-table input[type="text"]:focus,
.materiais-table input[type="number"]:focus {
  outline: none;
  border-color: var(--color-primary);
  background: rgba(255,255,255,0.1);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

.materiais-table input[type="file"] {
  width: 100%;
  color: var(--color-muted);
  font-size: 0.8rem;
}

/* Botão remover material */
.btn-remover-material {
  background: var(--color-danger);
  color: white;
  border: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 14px;
  font-weight: bold;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-remover-material:hover {
  background: #dc2626;
  transform: scale(1.1);
  box-shadow: 0 2px 4px rgba(220, 38, 38, 0.3);
}

/* Estados de validação para materiais */
.material-em-falta {
  background: rgba(220, 38, 38, 0.1) !important;
  border-color: rgba(220, 38, 38, 0.3) !important;
}

.material-em-falta input {
  border-color: var(--color-danger) !important;
  background: rgba(220, 38, 38, 0.1) !important;
}

/* Linha de erro para materiais */
.erro-material-row {
  background: rgba(220, 38, 38, 0.05) !important;
}

.erro-material-cell {
  padding: var(--space-1) var(--space-2) !important;
  border: none !important;
}

.erro-material-cell .campo-obrigatorio-label {
  margin: 0;
  font-size: 0.75rem;
  color: var(--color-danger);
  font-weight: 600;
}

/* === ESTILOS PARA RESUMO DE MATERIAIS === */

/* Tabela de materiais no resumo */
.resumo-materiais {
  margin-top: var(--space-2);
}

.resumo-materiais-table {
  width: 100%;
  border-collapse: collapse;
  background: rgba(0,0,0,0.2);
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.1);
}

.resumo-materiais-table th {
  background: rgba(255,255,255,0.1);
  color: var(--color-text);
  font-weight: 600;
  padding: var(--space-2);
  text-align: left;
  font-size: 0.85rem;
  border-bottom: 1px solid rgba(255,255,255,0.2);
}

.resumo-materiais-table td {
  padding: var(--space-2);
  color: var(--color-muted);
  font-size: 0.85rem;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.resumo-materiais-table tr:last-child td {
  border-bottom: none;
}

/* Responsividade para materiais */
@media (max-width: 768px) {
  .info-material-header {
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-2);
  }
  
  .btn-adicionar-material {
    width: 100%;
    justify-content: center;
  }
  
  .materiais-table th,
  .materiais-table td {
    padding: var(--space-1);
    font-size: 0.8rem;
  }
  
  .resumo-materiais-table {
    font-size: 0.8rem;
  }
  
  .resumo-materiais-table th,
  .resumo-materiais-table td {
    padding: var(--space-1);
  }
}

/* Campo de Manutenção Corretiva */
.manutencao-corretiva-section {
  background: rgba(245, 101, 101, 0.1);
  border: 1px solid rgba(245, 101, 101, 0.3);
  border-radius: 8px;
  padding: var(--space-4);
  margin-bottom: var(--space-5);
}

.manutencao-corretiva-section h4 {
  margin: 0 0 var(--space-3) 0;
  color: #dc2626;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.manutencao-corretiva-section h4::before {
  content: "🔧";
  font-size: 1.2rem;
}

.corretiva-container {
  background: rgba(0,0,0,0.2);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 6px;
  padding: var(--space-3);
}

.corretiva-label {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  margin-bottom: var(--space-3);
}

.corretiva-label strong {
  color: var(--color-text);
  font-size: 1rem;
}

.corretiva-info {
  color: var(--color-muted);
  font-size: 0.85rem;
  font-style: italic;
}

.corretiva-options {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.radio-option {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2);
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.radio-option:hover {
  background: rgba(255,255,255,0.05);
  border-color: var(--color-primary);
}

.radio-option input[type="radio"] {
  transform: scale(1.2);
  accent-color: #dc2626;
}

.radio-option span {
  color: var(--color-text);
  font-size: 0.9rem;
  user-select: none;
}

/* Estados de validação para manutenção corretiva */
.corretiva-em-falta {
  border-color: #dc2626 !important;
  background: rgba(220, 38, 38, 0.1) !important;
  animation: shake 0.5s ease-in-out;
}

/* Campo de Próxima Manutenção Preventiva */
.proxima-preventiva-section {
  background: rgba(37, 99, 235, 0.1);
  border: 1px solid rgba(37, 99, 235, 0.3);
  border-radius: 8px;
  padding: var(--space-4);
  margin-bottom: var(--space-5);
}

.proxima-preventiva-section h4 {
  margin: 0 0 var(--space-3) 0;
  color: var(--color-primary);
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.proxima-preventiva-section h4::before {
  content: "🔄";
  font-size: 1.2rem;
}

.proxima-preventiva-container {
  background: rgba(0,0,0,0.2);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 6px;
  padding: var(--space-3);
}

.proxima-preventiva-checkbox {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  cursor: pointer;
  user-select: none;
  padding: var(--space-2);
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 6px;
  transition: all 0.2s ease;
}

.proxima-preventiva-checkbox:hover {
  background: rgba(255,255,255,0.05);
  border-color: var(--color-primary);
}

.proxima-preventiva-checkbox input[type="checkbox"] {
  transform: scale(1.2);
  accent-color: var(--color-primary);
  cursor: pointer;
}

.proxima-preventiva-checkbox span {
  color: var(--color-text);
  font-size: 1rem;
  font-weight: 500;
}

.proxima-preventiva-campos {
  margin-top: var(--space-3);
  padding-top: var(--space-3);
  border-top: 1px solid rgba(255,255,255,0.1);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.proxima-preventiva-campos .field label {
  color: var(--color-text);
  font-weight: 500;
}

.proxima-preventiva-campos .field small {
  display: block;
  margin-top: var(--space-1);
  color: var(--color-muted);
  font-size: 0.85rem;
  font-style: italic;
}

.proxima-preventiva-campos .field input[type="date"],
.proxima-preventiva-campos .field input[type="time"] {
  width: 100%;
  padding: var(--space-2);
  background: rgba(0,0,0,0.3);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 6px;
  color: var(--color-text);
  font-size: 1rem;
  min-height: 44px;
  transition: all 0.2s ease;
}

.proxima-preventiva-campos .field input[type="date"]:focus,
.proxima-preventiva-campos .field input[type="time"]:focus {
  outline: none;
  border-color: var(--color-primary);
  background: rgba(0,0,0,0.4);
}

.proxima-preventiva-campos .field input.erro {
  border-color: #dc2626;
  background: rgba(220, 38, 38, 0.1);
}

/* Estados de validação para próxima preventiva */
.proxima-preventiva-em-falta {
  border-color: #dc2626 !important;
  background: rgba(220, 38, 38, 0.1) !important;
  animation: shake 0.5s ease-in-out;
}

/* Responsividade para campos de próxima preventiva */
@media (max-width: 768px) {
  .proxima-preventiva-campos {
    gap: var(--space-2);
  }
  
  .proxima-preventiva-campos .field input[type="date"],
  .proxima-preventiva-campos .field input[type="time"] {
    font-size: 16px; /* Evita zoom no iOS */
  }
}

/* Declaração de Conclusão */
.declaracao-conclusao {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.1) 0%, rgba(16, 185, 129, 0.1) 100%);
  border: 2px solid rgba(37, 99, 235, 0.3);
  border-left: 5px solid var(--color-primary);
  border-radius: 8px;
  padding: var(--space-4);
  margin-bottom: var(--space-5);
  animation: fadeInSlide 0.4s ease-out;
}

.declaracao-conclusao p {
  color: var(--color-text);
  font-size: 0.95rem;
  line-height: 1.7;
  margin: 0;
  text-align: justify;
  font-weight: 500;
}

/* Animação para a declaração */
@keyframes fadeInSlide {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Dados de Faturação */
.dados-faturacao-container {
  background: rgba(16, 185, 129, 0.08);
  border: 2px solid rgba(16, 185, 129, 0.3);
  border-left: 5px solid var(--color-secondary);
  border-radius: 8px;
  padding: var(--space-4);
  margin-bottom: var(--space-5);
}

.dados-faturacao-container h4 {
  margin: 0 0 var(--space-2) 0;
  color: var(--color-secondary);
  font-size: 1.1rem;
}

.faturacao-info {
  color: var(--color-muted);
  font-size: 0.9rem;
  margin: 0 0 var(--space-4) 0;
  line-height: 1.5;
}

.faturacao-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-3);
}

.faturacao-fields .field {
  margin-bottom: 0;
}

.faturacao-fields label {
  display: block;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: var(--space-1);
  font-size: 0.9rem;
}

.faturacao-fields input,
.faturacao-fields textarea {
  width: 100%;
  padding: var(--space-2);
  background: rgba(0,0,0,0.3);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 6px;
  color: var(--color-text);
  font-size: 0.95rem;
  transition: all 0.2s ease;
}

.faturacao-fields input:focus,
.faturacao-fields textarea:focus {
  outline: none;
  border-color: var(--color-secondary);
  background: rgba(0,0,0,0.4);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.faturacao-fields input::placeholder,
.faturacao-fields textarea::placeholder {
  color: rgba(148, 163, 184, 0.5);
}

.faturacao-fields textarea {
  resize: vertical;
  min-height: 60px;
  font-family: inherit;
}

/* Estados de validação para campos de faturação */
.faturacao-fields input.campo-em-falta,
.faturacao-fields textarea.campo-em-falta {
  border-color: var(--color-danger) !important;
  background: rgba(220, 38, 38, 0.1) !important;
  animation: shake 0.5s ease-in-out;
}

/* Container de Assinaturas */
.assinaturas-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-5);
}

.assinatura-field {
  background: rgba(0,0,0,0.2);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  padding: var(--space-3);
}

.assinatura-field h4 {
  margin: 0 0 var(--space-2) 0;
  color: var(--color-text);
  font-size: 0.95rem;
  text-align: center;
}

/* Canvas de Assinatura */
.signature-canvas {
  width: 100%;
  height: 150px;
  border: 2px solid rgba(255,255,255,0.1);
  border-radius: 6px;
  background: rgba(255,255,255,0.95);
  cursor: crosshair;
  display: block;
  margin-bottom: var(--space-2);
}

.signature-canvas:hover {
  border-color: var(--color-primary);
}

.signature-canvas.signing {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Controles de Assinatura */
.signature-controls {
  text-align: center;
}

/* Ações de Confirmação */
.confirmacao-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-3);
}

/* Estados do botão gerar PDF */
#btn-gerar-pdf:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Destacar campos obrigatórios em falta */
.verificacao-em-falta {
  background: rgba(220, 38, 38, 0.1) !important;
  border: 2px solid #dc2626 !important;
  animation: shake 0.5s ease-in-out;
}

.verificacao-em-falta td {
  border-color: rgba(220, 38, 38, 0.3) !important;
}

.observacoes-em-falta {
  border: 2px solid #dc2626 !important;
  background: rgba(220, 38, 38, 0.05) !important;
  animation: shake 0.5s ease-in-out;
}

.campo-obrigatorio-label {
  color: #dc2626;
  font-weight: bold;
  font-size: 0.85rem;
  margin-top: var(--space-1);
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.campo-obrigatorio-label::before {
  content: "⚠️";
  font-size: 0.9rem;
}

/* Animação de shake */
@keyframes shake {
  0%, 20%, 50%, 80%, 100% {
    transform: translateX(0);
  }
  10% {
    transform: translateX(-5px);
  }
  30% {
    transform: translateX(5px);
  }
  60% {
    transform: translateX(-3px);
  }
  90% {
    transform: translateX(3px);
  }
}

/* Responsividade para relatórios */
@media (max-width: 768px) {
  .servico-details {
    grid-template-columns: 1fr;
  }
  
  .verificacoes-table-container {
    font-size: 0.85rem;
  }
  
  .verificacoes-table th,
  .verificacoes-table td {
    padding: var(--space-2);
  }
  
  .assinaturas-container {
    grid-template-columns: 1fr;
  }
  
  .verificacoes-actions,
  .confirmacao-actions {
    flex-direction: column;
    align-items: stretch;
  }
  
  .verificacoes-actions .btn,
  .confirmacao-actions .btn {
    width: 100%;
    margin-bottom: var(--space-2);
  }
  
  .verificacoes-actions .btn:last-child,
  .confirmacao-actions .btn:last-child {
    margin-bottom: 0;
  }
}

/* ===== INDICADOR DE AUTO-SAVE ===== */
.autosave-indicator {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  color: white;
  opacity: 0;
  transform: translateY(-10px);
  transition: all 0.3s ease;
  pointer-events: none;
  max-width: 300px;
  word-wrap: break-word;
}

.autosave-indicator.show {
  opacity: 1;
  transform: translateY(0);
}

.autosave-indicator.success {
  background: rgba(5, 150, 105, 0.9);
  border: 1px solid rgba(5, 150, 105, 0.3);
}

.autosave-indicator.info {
  background: rgba(37, 99, 235, 0.9);
  border: 1px solid rgba(37, 99, 235, 0.3);
}

.autosave-indicator.error {
  background: rgba(220, 38, 38, 0.9);
  border: 1px solid rgba(220, 38, 38, 0.3);
}

/* Responsividade para dispositivos móveis */
@media (max-width: 768px) {
  .autosave-indicator {
    top: 10px;
    right: 10px;
    left: 10px;
    max-width: none;
    text-align: center;
  }
}

/* ===== INTERFACE DE RASCUNHOS ===== */
.rascunho-actions {
  display: flex;
  gap: var(--space-1);
  flex-wrap: nowrap;
  justify-content: center;
}

.rascunho-actions .btn {
  font-size: 0.85rem;
  padding: var(--space-2) var(--space-3);
  min-width: auto;
  white-space: nowrap;
}

.rascunhos-container {
  margin-top: var(--space-3);
}

.rascunhos-section {
  margin-bottom: var(--space-4);
}

.rascunhos-section h4 {
  margin: 0 0 var(--space-2) 0;
  color: var(--color-muted);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.rascunhos-lista {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  max-height: 300px;
  overflow-y: auto;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  padding: var(--space-2);
  background: rgba(255,255,255,0.02);
}

.rascunho-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  padding: var(--space-3);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  background: var(--color-card);
  transition: all 0.2s ease;
}

.rascunho-item:hover {
  border-color: var(--color-primary);
  background: rgba(37, 99, 235, 0.1);
}

.rascunho-item.selected {
  border-color: var(--color-primary);
  background: rgba(37, 99, 235, 0.2);
}

.rascunho-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  margin-bottom: var(--space-2);
}

.rascunho-nome {
  font-weight: 600;
  color: var(--color-text);
  margin: 0;
  font-size: 0.95rem;
}

.rascunho-servico {
  background: var(--color-primary);
  color: white;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 500;
}

.rascunho-meta {
  display: flex;
  gap: var(--space-2);
  align-items: center;
  font-size: 0.85rem;
  color: var(--color-muted);
  margin-top: 4px;
}

.rascunho-data {
  font-size: 0.85rem;
  color: var(--color-muted);
}

.rascunho-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.rascunho-timestamp {
  font-style: italic;
}

.rascunho-acoes {
  display: flex;
  gap: var(--space-1);
  margin-top: var(--space-2);
}

.rascunho-btn {
  padding: 4px 8px;
  border: none;
  border-radius: 4px;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.rascunho-btn-carregar {
  background: var(--color-secondary);
  color: white;
}

.rascunho-btn-excluir {
  background: var(--color-danger);
  color: white;
}

.rascunho-btn:hover {
  opacity: 0.8;
  transform: translateY(-1px);
}

.info-section {
  background: rgba(37, 99, 235, 0.1);
  border: 1px solid rgba(37, 99, 235, 0.3);
  border-radius: 8px;
  padding: var(--space-3);
  margin-bottom: var(--space-3);
}

.info-section p {
  margin: 0;
  font-size: 0.9rem;
}

.info-section small {
  color: var(--color-muted);
}

/* Adaptação para dispositivos móveis */
@media (max-width: 768px) {
  .rascunho-actions {
    width: 100%;
    justify-content: center;
    gap: var(--space-1);
  }
  
  .rascunho-actions .btn {
    flex: 0 1 auto;
    min-width: 120px;
    font-size: 0.8rem;
    padding: var(--space-2);
  }
  
  .rascunho-header {
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-1);
  }
  
  .rascunho-info {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
  
  .rascunho-acoes {
    justify-content: center;
  }
}

/* ===== ESTILOS PARA SISTEMA DE FOTOS ===== */

/* Indicador de upload de foto */
.foto-upload-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  background: rgba(37, 99, 235, 0.1);
  border: 1px solid var(--color-primary);
  border-radius: 4px;
  padding: var(--space-1);
}

/* Animação do spinner */
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Interface de foto enviada */
.foto-enviada {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: rgba(5, 150, 105, 0.1);
  border: 1px solid var(--color-secondary);
  border-radius: 4px;
  padding: 6px;
  min-height: 60px;
}

.foto-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.foto-nome {
  font-size: 0.75rem;
  color: var(--color-text);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 4px;
}

.foto-tamanho {
  font-size: 0.7rem;
  color: var(--color-muted);
  font-style: italic;
}

.foto-acoes {
  display: flex;
  gap: 4px;
  justify-content: center;
  margin-top: 4px;
}

/* Botões de ação de foto */
.foto-btn {
  background: var(--color-tertiary);
  color: white;
  border: none;
  border-radius: 3px;
  padding: 4px 6px;
  font-size: 0.7rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 20px;
}

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

.foto-btn-ver {
  background: var(--color-primary);
}

.foto-btn-trocar {
  background: var(--color-tertiary);
}

/* Melhorias no input de arquivo */
.materiais-table input[type="file"] {
  font-size: 0.75rem;
  padding: 4px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 3px;
  color: var(--color-muted);
  cursor: pointer;
  transition: all 0.2s ease;
}

.materiais-table input[type="file"]:hover {
  border-color: var(--color-primary);
  background: rgba(255,255,255,0.1);
}

.materiais-table input[type="file"]:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

/* Coluna de foto mais estreita */
.materiais-table th:nth-child(6),
.materiais-table td:nth-child(6) {
  width: 100px;
  min-width: 100px;
  max-width: 100px;
}

/* Responsividade para fotos */
@media (max-width: 768px) {
  .foto-enviada {
    min-height: 50px;
    padding: 4px;
  }
  
  .foto-nome {
    font-size: 0.7rem;
  }
  
  .foto-tamanho {
    font-size: 0.65rem;
  }
  
  .foto-btn {
    min-width: 20px;
    height: 18px;
    font-size: 0.65rem;
    padding: 2px 4px;
  }
  
  .materiais-table th:nth-child(6),
  .materiais-table td:nth-child(6) {
    width: 80px;
    min-width: 80px;
    max-width: 80px;
  }
}

/* ===== ESTILOS PARA BOTÕES DE FOTO MINIMALISTAS ===== */

.btn-photo-minimal {
  min-width: 36px !important;
  width: 36px !important;
  height: 36px !important;
  padding: 4px !important;
  border-radius: 50% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 16px !important;
  background: rgba(107, 114, 128, 0.6) !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
  color: white !important;
  transition: all 0.2s ease !important;
  cursor: pointer !important;
}

.btn-photo-minimal:hover {
  background: rgba(107, 114, 128, 0.8) !important;
  border-color: rgba(255, 255, 255, 0.4) !important;
  transform: scale(1.1) !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) !important;
}

.btn-photo-minimal:active {
  transform: scale(0.95) !important;
}

.btn-photo-minimal.btn-sm {
  min-width: 28px !important;
  width: 28px !important;
  height: 28px !important;
  padding: 2px !important;
  font-size: 14px !important;
}

/* Estilos para Informações do Cliente Carregadas Automaticamente */
.info-cliente-box {
  background: linear-gradient(135deg, #e3f2fd 0%, #f0f9ff 100%);
  border: 2px solid #1976d2;
  border-radius: 8px;
  padding: 12px;
  margin: 10px 0;
  box-shadow: 0 2px 8px rgba(25, 118, 210, 0.15);
  display: none;
}

.info-cliente-box .info-header {
  display: flex;
  align-items: center;
  margin-bottom: 8px;
  color: #1565c0;
}

.info-cliente-box .info-header i {
  margin-right: 8px;
  font-size: 1.1em;
}

.info-cliente-box .info-content {
  font-size: 0.9em;
  line-height: 1.4;
}

.info-cliente-box .info-content p {
  margin: 4px 0;
  color: #424242;
}

.info-cliente-box .info-content strong {
  color: #1565c0;
  font-weight: 600;
}

/* Feedback de validação de cliente */
.cliente-feedback {
  margin-top: 8px;
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.3s ease;
}

.cliente-feedback.success {
  background-color: rgba(5, 150, 105, 0.1);
  color: #10b981;
  border-left: 3px solid #10b981;
}

.cliente-feedback.error {
  background-color: rgba(220, 38, 38, 0.1);
  color: #ef4444;
  border-left: 3px solid #ef4444;
}

.cliente-feedback.hidden {
  display: none;
}

/* ========== Estilos para Relatório de Instalação ========== */
.instalacao-container {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding: var(--space-3);
  background: var(--color-card);
  border-radius: 8px;
}

.material-aplicado-section {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-2);
}

.section-header h4 {
  margin: 0;
  color: var(--color-text);
  font-size: 1.1rem;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.field-label {
  font-weight: 600;
  color: var(--color-text);
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.field-required {
  color: var(--color-danger);
  font-size: 0.85rem;
  font-weight: 400;
}

.field-optional {
  color: var(--color-muted);
  font-size: 0.85rem;
  font-weight: 400;
}

.field-input {
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  color: var(--color-text);
  font-size: 0.95rem;
  transition: all 0.2s ease;
}

.field-input:focus {
  outline: none;
  border-color: var(--color-primary);
  background: rgba(255, 255, 255, 0.08);
}

.field-input.campo-obrigatorio {
  border-color: var(--color-danger);
  animation: shake 0.3s;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

.materiais-table-container {
  overflow-x: auto;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.materiais-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 600px;
}

.materiais-table th {
  background: rgba(37, 99, 235, 0.1);
  color: var(--color-text);
  padding: 12px;
  text-align: left;
  font-weight: 600;
  font-size: 0.9rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.materiais-table td {
  padding: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.materiais-table tr:last-child td {
  border-bottom: none;
}

.materiais-table input {
  width: 100%;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  color: var(--color-text);
  font-size: 0.9rem;
  transition: all 0.2s ease;
}

.materiais-table input:focus {
  outline: none;
  border-color: var(--color-primary);
  background: rgba(255, 255, 255, 0.08);
}

.btn-remover-material {
  background: rgba(220, 38, 38, 0.1);
  border: 1px solid rgba(220, 38, 38, 0.3);
  color: var(--color-danger);
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 1.2rem;
  font-weight: bold;
  transition: all 0.2s ease;
}

.btn-remover-material:hover {
  background: rgba(220, 38, 38, 0.2);
  transform: scale(1.1);
}

.upload-fotos-area {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.upload-fotos-area .btn-photo-minimal {
  align-self: flex-start;
  min-width: auto !important;
  width: auto !important;
  padding: 10px 16px !important;
  border-radius: 6px !important;
  font-size: 0.95rem !important;
  height: auto !important;
  display: inline-flex !important;
  gap: var(--space-1);
}

.fotos-lista {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-top: var(--space-2);
}

.foto-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  transition: all 0.2s ease;
}

.foto-item:hover {
  background: rgba(255, 255, 255, 0.08);
}

.foto-nome {
  color: var(--color-text);
  font-size: 0.9rem;
  flex: 1;
}

.foto-acoes {
  display: flex;
  gap: var(--space-1);
}

.btn-ver-foto {
  padding: 6px 12px;
  background: rgba(37, 99, 235, 0.1);
  border: 1px solid rgba(37, 99, 235, 0.3);
  color: var(--color-primary);
  border-radius: 4px;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-ver-foto:hover {
  background: rgba(37, 99, 235, 0.2);
}

.btn-remover-foto {
  background: rgba(220, 38, 38, 0.1);
  border: 1px solid rgba(220, 38, 38, 0.3);
  color: var(--color-danger);
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 1.1rem;
  font-weight: bold;
  transition: all 0.2s ease;
}

.btn-remover-foto:hover {
  background: rgba(220, 38, 38, 0.2);
}

/* Estilos para resumo de instalação */
.resumo-instalacao {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.resumo-section {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: var(--space-3);
}

.resumo-section h5 {
  margin: 0 0 var(--space-2) 0;
  color: var(--color-primary);
  font-size: 1rem;
}

.resumo-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: var(--space-2);
}

.resumo-table th {
  background: rgba(37, 99, 235, 0.1);
  padding: 10px;
  text-align: left;
  font-size: 0.85rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.resumo-table td {
  padding: 10px;
  font-size: 0.9rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.resumo-table tr:last-child td {
  border-bottom: none;
}

.resumo-value {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--color-text);
  margin: 0;
}

.resumo-text {
  font-size: 0.95rem;
  color: var(--color-text);
  line-height: 1.6;
  margin: 0;
}

.resumo-empty {
  color: var(--color-muted);
  font-style: italic;
  font-size: 0.9rem;
  margin: 0;
}

/* ===== Modal de Novidades ===== */
.modal-novidades {
  max-width: 600px;
  animation: slideUpFadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.modal-header-novidades {
  background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
  padding: var(--space-5) var(--space-4);
  border-radius: 12px 12px 0 0;
  border-bottom: none;
}

.novidades-header-content h3 {
  margin: 0 0 var(--space-1) 0;
  font-size: 1.5rem;
  font-weight: 700;
  color: white;
}

.novidades-subtitle {
  margin: 0;
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.9);
  font-weight: 400;
}

.modal-body-novidades {
  padding: var(--space-4);
}

.novidades-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}

.novidade-item {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-3);
  background: rgba(37, 99, 235, 0.05);
  border: 1px solid rgba(37, 99, 235, 0.1);
  border-radius: 8px;
  transition: all 0.2s ease;
}

.novidade-item:hover {
  background: rgba(37, 99, 235, 0.08);
  border-color: rgba(37, 99, 235, 0.2);
  transform: translateX(4px);
}

.novidade-icon {
  font-size: 2rem;
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(37, 99, 235, 0.1);
  border-radius: 8px;
}

.novidade-content h4 {
  margin: 0 0 var(--space-1) 0;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--color-text);
}

.novidade-content p {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--color-muted);
}

.novidades-footer {
  padding: var(--space-3);
  background: rgba(37, 99, 235, 0.05);
  border-radius: 8px;
  border-left: 3px solid var(--color-primary);
}

.novidades-info {
  margin: 0;
  font-size: 0.9rem;
  color: var(--color-text);
  font-weight: 500;
}

.modal-actions-novidades {
  padding: var(--space-4);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  justify-content: center;
}

.btn-novidades-ok {
  padding: 12px 32px;
  font-size: 1rem;
  font-weight: 600;
  min-width: 200px;
}

@media (max-width: 768px) {
  .modal-novidades {
    max-width: 95%;
    margin: var(--space-3);
  }
  
  .novidade-item {
    flex-direction: column;
    text-align: center;
  }
  
  .novidade-icon {
    margin: 0 auto;
  }
  
  .btn-novidades-ok {
    width: 100%;
  }
}


