/* RESET & BASICS */
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { width: 100%; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: linear-gradient(135deg, #ff9a56 0%, #ffad56 100%);
  background-attachment: fixed;
  min-height: 100vh;
  display: flex; justify-content: center; align-items: center;
  padding: 2rem;
}

/* CARD */
.container {
  background-color: #ffffff;
  padding: 3rem;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
  width: 100%; max-width: 520px;
  animation: fadeIn 0.5s ease-out;
}
@keyframes fadeIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

/* HEADER */
.header { text-align: center; margin-bottom: 2rem; }

/* Ajuste para o ícone de imagem */
.icon { 
  margin-bottom: 0.5rem; 
  display: flex; 
  justify-content: center; 
}
.icon img {
  width: 64px;
  height: auto;
  object-fit: contain;
}

h1 { color: #1a202c; font-size: 1.75rem; font-weight: 700; margin-bottom: 0.5rem; }
.subtitle { color: #718096; font-size: 0.95rem; }

/* FORM ELEMENTS */
.form-group { margin-bottom: 1.5rem; }
label { display: block; margin-bottom: 0.5rem; color: #2d3748; font-weight: 600; font-size: 0.9rem; }

input, select {
  width: 100%; padding: 0.8rem; border: 2px solid #e2e8f0;
  border-radius: 10px; font-size: 1rem; background-color: #f7fafc;
  transition: 0.3s;
}
input:focus { outline: none; border-color: #ff8c42; background: #fff; }

/* INVENTÁRIO DISPLAY */
#total-display {
  text-align: center; padding: 0.8rem; margin-bottom: 1.5rem;
  background: #fffaf0; border: 2px solid #ff8c42; border-radius: 10px;
  color: #c05621; font-weight: bold;
}

/* HORÁRIOS CONTAINER */
.horarios-container {
  max-height: 250px; overflow-y: auto;
  border: 2px solid #e2e8f0; border-radius: 10px; padding: 1rem;
  background: #f7fafc; position: relative;
}

/* Loader interno dos horários */
.loader-overlay {
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(255,255,255,0.8); z-index: 5;
  display: none; flex-direction: column;
  align-items: center; justify-content: center; font-weight: bold;
  color: #2d3748;
}
.horarios-container.loading .loader-overlay { display: flex; }

.checkbox-item {
  display: flex; align-items: center; padding: 0.5rem;
  border-radius: 6px; margin-bottom: 0.2rem; cursor: pointer;
}
.checkbox-item:hover { background: #edf2f7; }
.checkbox-item input { width: auto; margin-right: 10px; cursor: pointer; accent-color: #ff8c42; }
.checkbox-item label { margin: 0; cursor: pointer; flex: 1; font-weight: 500; line-height: 1.4; }

/* Status Colors */
.status-ok { color: #2f855a; font-size: 0.85em; margin-left: 5px; }
.status-full { color: #c53030; font-size: 0.85em; margin-left: 5px; font-weight: bold; }

.checkbox-item.disabled { opacity: 0.5; pointer-events: none; background-color: #f7fafc; }
.checkbox-item.disabled label { text-decoration: line-through; color: #a0aec0; }

/* BUTTON */
button {
  width: 100%; padding: 1rem; border: none; border-radius: 12px;
  background: linear-gradient(135deg, #ff8c42 0%, #ffad56 100%);
  color: white; font-size: 1.1rem; font-weight: bold; cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}
button:hover { transform: translateY(-2px); box-shadow: 0 5px 15px rgba(255, 140, 66, 0.4); }
button:disabled { background: #ccc; transform: none; cursor: not-allowed; }

/* GLOBAL LOADER (Spinner) */
#global-loader {
  display: none; margin: 1rem auto; width: 30px; height: 30px;
  border: 4px solid #eee; border-top: 4px solid #ff8c42; border-radius: 50%;
  animation: spin 1s linear infinite;
}
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

/* MESSAGES */
#message {
  display: none; margin-top: 1rem; padding: 1rem; border-radius: 10px;
  text-align: center; font-weight: bold;
}
.msg-success { background: #c6f6d5; color: #22543d; border: 1px solid #9ae6b4; }
.msg-error { background: #fed7d7; color: #742a2a; border: 1px solid #fc8181; text-align: left; }

/* MOBILE RESPONSIVE */
@media(max-width: 600px) {
  .container { padding: 1.5rem; }
  body { padding: 1rem; }
  h1 { font-size: 1.4rem; }
  .icon img { width: 50px; }
  input, select, button { padding: 0.8rem; }
}