/* ======== ESTILOS GERAIS ======== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: "Inter", sans-serif;
}

body {
  background: #1e1f24;
  color: #e0e0e0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  min-height: 100vh;
}

/* ======== CABEÇALHO ======== */
header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background: #2b2c30;
  color: #f2f2f2;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 40px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.35);
  z-index: 1000;
}

header h1 {
  font-size: 1.8rem;
  font-weight: 600;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  font-weight: bold;
}

.search-bar {
  display: flex;
  gap: 10px;
}

.search-bar input {
  padding: 10px 14px;
  border-radius: 10px;
  border: none;
  width: 240px;
  font-size: 1rem;
  outline: none;
  background: #3a3b40;
  color: #f2f2f2;
}

.search-bar button {
  background: #3a3b40;
  color: #f2f2f2;
  border: none;
  border-radius: 10px;
  padding: 10px 16px;
  cursor: pointer;
  font-weight: 600;
  transition: 0.2s;
}

.search-bar button:hover {
  background: #4a4b50;
}

/* ======== BOTÃO LÓGICA ======== */
#logica-btn {
  background: #3a3b40;
  color: #f2f2f2;
  border: none;
  border-radius: 10px;
  padding: 10px 16px;
  cursor: pointer;
  font-weight: 600;
  transition: 0.2s;
}

#logica-btn:hover {
  background: #4a4b50;
}

/* ======== NOVO BOTÃO — LAUDO IRREPARÁVEL ======== */
#header-irreparavel-btn {
  background: #7a1f1f;
  color: #f8d7da;
  border: none;
  border-radius: 10px;
  padding: 10px 16px;
  cursor: pointer;
  font-weight: 600;
  transition: 0.2s;
}

#header-irreparavel-btn:hover {
  background: #a62a2a;
}

/* ======== BARRA DE STATUS ======== */
#status-bar {
  width: 90%;
  max-width: 900px;
  text-align: center;
  padding: 14px 20px;
  font-weight: 600;
  font-size: 1rem;
  border-radius: 10px;
  margin-top: 95px;
  margin-bottom: 20px;
  letter-spacing: 0.3px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease-in-out;
}

#status-text {
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

/* Estados visuais */
.status-faz-laudo {
  background-color: #1b5e20;
  color: #d8ffd8;
  border: 2px solid #2e7d32;
}

.status-nao-laudo {
  background-color: #5c5300;
  color: #fff6d0;
  border: 2px solid #b59f00;
}

/* ======== CONTEÚDO PRINCIPAL ======== */
main {
  flex: 1 0 auto;
  margin-top: 20px;
  margin-bottom: 80px;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

/* ======== CÂMERA ======== */
#camera-container {
  background: #2b2c30;
  border-radius: 25px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
  width: 900px;
  padding: 25px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease-in-out;
}

#camera {
  width: 850px;
  height: 600px;
  border-radius: 16px;
  background: #000;
  margin: 15px 0;
  object-fit: cover;
}

#capture-btn {
  background: #4a4b50;
  color: #f2f2f2;
  border: none;
  border-radius: 12px;
  padding: 12px 18px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
  transition: background 0.2s;
}

#capture-btn:hover {
  background: #5a5b60;
}

/* ======== MODAL (Pré-visualização) ======== */
#preview-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(6px);
  z-index: 9999;
}

.modal-content {
  background: rgba(43, 44, 48, 0.9);
  backdrop-filter: blur(10px);
  border-radius: 25px;
  padding: 30px;
  box-shadow: 0 6px 25px rgba(0, 0, 0, 0.4);
  width: 650px;
  text-align: center;
  animation: fadeIn 0.3s ease-in-out;
  color: #e0e0e0;
}

.modal-content h3 {
  margin-bottom: 8px;
  color: #f2f2f2;
}

.modal-content p {
  font-size: 0.95rem;
  color: #bbb;
}

.photo-grid {
  display: flex;
  justify-content: center;
  gap: 25px;
  margin: 20px 0;
}

.photo-box {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.photo-box h4 {
  margin-bottom: 6px;
  font-weight: 600;
  color: #ddd;
}

/* ❌ ERRADO NO SEU CSS:
   photo-box img { ... } 
   ⛔ Sem o ponto → CSS invalido → preview quebra */

.photo-box img {
  width: 230px;
  border-radius: 15px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.4);
  transition: transform 0.2s ease;
}

/* ======== FOOTER ======== */
footer {
  margin-top: auto;
  width: 100%;
  background: #2b2c30;
  color: #bbb;
  text-align: center;
  padding: 12px 0;
  font-size: 0.9rem;
  border-top: 1px solid #3a3b40;
  box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.25);
}

footer .marca {
  vertical-align: super;
  font-size: 0.8rem;
}

/* ======== PAINEL LATERAL ======== */
#logica-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 0;
  height: 100vh;
  background: rgba(43, 44, 48, 0.98);
  overflow-y: auto;
  box-shadow: -6px 0 20px rgba(0, 0, 0, 0.4);
  transition: width 0.4s ease;
  z-index: 2000;
  color: #f2f2f2;
  padding: 0;
}

#logica-panel.active {
  width: 35%;
  padding: 30px 25px;
}

.panel-content {
  opacity: 0;
  transition: opacity 0.3s ease;
}

#logica-panel.active .panel-content {
  opacity: 1;
}

#close-panel {
  position: absolute;
  top: 15px;
  right: 20px;
  background: transparent;
  border: none;
  color: #ccc;
  font-size: 1.5rem;
  cursor: pointer;
}

.hidden {
  display: none !important;
}

/* ======== MODAL NOVO — LAUDO IRREPARÁVEL DIRETO ======== */

#modal-irreparavel {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(6px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 99999;
}

#modal-irreparavel .modal-content {
  width: 500px;
  background: #2b2c30;
  padding: 30px;
  border-radius: 22px;
  box-shadow: 0 6px 25px rgba(0,0,0,0.45);
  animation: fadeIn 0.3s ease-in-out;
}

#modal-irreparavel h3 {
  color: #fff;
  margin-bottom: 12px;
}

#modal-irreparavel p {
  color: #ccc;
  margin-bottom: 20px;
}

.form-group {
  margin-bottom: 16px;
  text-align: left;
}

.form-group label {
  display: block;
  margin-bottom: 5px;
  color: #eee;
  font-weight: 600;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid #555;
  background: #1f1f1f;
  color: #f2f2f2;
  outline: none;
  font-size: 15px;
}

#irreparavel-cancelar {
  background: #555;
  color: #eee;
  padding: 10px 16px;
  border-radius: 8px;
}

#irreparavel-iniciar-fotos {
  background: #b71c1c;
  color: #fff;
  padding: 10px 16px;
  border-radius: 8px;
}

/* ======== ANIMAÇÃO ======== */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(15px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   === AJUSTES DO PREVIEW E BOTÕES – NÃO APAGAR ===
   ============================================================ */

/* Corrige imagem gigante no preview */
.photo-box img {
  width: 230px !important;
  max-height: 300px;
  object-fit: cover;
}

/* Mantém grid certo */
.photo-grid {
  display: flex;
  justify-content: center;
  gap: 25px;
}

/* Botões do preview */
.modal-actions {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 15px;
}

.modal-actions button {
  padding: 12px 20px;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  transition: 0.2s ease;
}

/* Manter */
#manter-btn {
  background: #3a3b40 !important;
  color: #f2f2f2 !important;
}
#manter-btn:hover {
  background: #4a4b50 !important;
}

/* Refazer */
#refazer-btn {
  background: #5a2d2d !important;
  color: #f8d7da !important;
}
#refazer-btn:hover {
  background: #7a3c3c !important;
}

/* Irreparável dentro do preview */
#irreparavel-btn {
  background: #8b0000 !important;
  color: #ffeaea !important;
}
#irreparavel-btn:hover {
  background: #a30000 !important;
}

/* ============================
   ESTILIZAÇÃO FALTANTE — IRREPARÁVEL (PREVIEW)
   ============================ */

#irreparavel-box {
  margin-top: 20px;
  padding: 16px;
  background: #2c2c2c;
  border-radius: 10px;
  border: 1px solid #444;
  box-shadow: 0 0 10px rgba(0,0,0,0.3);
  text-align: center;
  animation: fadeIn 0.3s ease-in-out;
}

#irreparavel-box h4 {
  color: #f0f0f0;
  margin-bottom: 10px;
  font-weight: 600;
}

#irreparavel-select {
  width: 80%;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid #666;
  background: #1e1e1e;
  color: #f5f5f5;
  font-size: 15px;
  margin-bottom: 15px;
  outline: none;
}

#irreparavel-select:focus {
  border-color: #3498db;
  box-shadow: 0 0 4px #3498db;
}

#confirmar-irreparavel {
  background-color: #d32f2f;
  color: #fff;
  border: none;
  padding: 10px 18px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: bold;
  font-size: 0.95rem;
  transition: 0.2s ease-in-out;
  margin-top: 5px;
}

#confirmar-irreparavel:hover {
  background-color: #ff5555;
  transform: scale(1.05);
}
