:root {
  --red: #b30000;
  --gray-bg: #f2f2f2;
  --border: #ccc;
  --text: #222;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--gray-bg);
  color: var(--text);
  padding-bottom: 40px;
}

.app-header {
  background: var(--red);
  color: #fff;
  padding: 16px;
  text-align: center;
}
.app-header h1 {
  margin: 0;
  font-size: 1.3rem;
}
.app-header .subtitle {
  margin: 4px 0 0;
  font-size: 0.85rem;
  opacity: 0.9;
}

form {
  max-width: 640px;
  margin: 0 auto;
  padding: 12px;
}

.card {
  background: #fff;
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 14px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.card h2 {
  margin: 0 0 10px;
  font-size: 1.05rem;
  color: var(--red);
  border-bottom: 2px solid var(--red);
  padding-bottom: 6px;
}

.hint {
  font-size: 0.8rem;
  color: #666;
  margin: 0 0 10px;
}

label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin: 10px 0 4px;
}

input[type="text"],
input[type="date"],
input[type="datetime-local"],
textarea {
  width: 100%;
  padding: 10px;
  font-size: 1rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  font-family: inherit;
}

input[readonly] {
  background: #eee;
  color: #555;
}

textarea {
  resize: vertical;
}

.computed-row {
  display: flex;
  gap: 10px;
}
.computed-row > div {
  flex: 1;
}

/* Turno / Tempo grid */
.turno-grid {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}
.turno-grid th, .turno-grid td {
  border: 1px solid var(--border);
  text-align: center;
  padding: 6px 2px;
  font-size: 0.75rem;
}
.turno-grid thead th {
  background: #f7f7f7;
  font-weight: 600;
}
.turno-grid tbody th {
  background: #f7f7f7;
  font-weight: 600;
  text-align: left;
  padding-left: 8px;
}
.turno-cell {
  height: 38px;
  cursor: pointer;
  position: relative;
}
.turno-cell.selected {
  background: var(--red);
}
.turno-cell.selected::after {
  content: "X";
  color: #fff;
  font-weight: bold;
}

/* Dynamic lists */
.dynamic-list { display: flex; flex-direction: column; gap: 10px; }
.list-item {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
  position: relative;
  background: #fafafa;
}
.list-item label {
  margin-top: 6px;
}
.list-item label:first-child {
  margin-top: 0;
}
.btn-remove {
  position: absolute;
  top: 6px;
  right: 6px;
  background: none;
  border: none;
  color: var(--red);
  font-size: 1.1rem;
  font-weight: bold;
  cursor: pointer;
  line-height: 1;
  padding: 4px;
}
.btn-add {
  margin-top: 10px;
  width: 100%;
  padding: 10px;
  background: #fff;
  border: 2px dashed var(--red);
  color: var(--red);
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
}

/* Foto item */
.foto-preview {
  width: 100%;
  max-height: 200px;
  object-fit: contain;
  border-radius: 6px;
  margin-top: 8px;
  display: none;
  background: #eee;
}
.foto-preview.show { display: block; }

/* Submit bar */
.submit-bar {
  text-align: center;
  margin-top: 10px;
}
.btn-primary {
  width: 100%;
  padding: 16px;
  font-size: 1.1rem;
  font-weight: bold;
  background: var(--red);
  color: #fff;
  border: none;
  border-radius: 10px;
  cursor: pointer;
}
.btn-primary:disabled {
  opacity: 0.6;
}
.status-msg {
  margin-top: 10px;
  font-size: 0.9rem;
  min-height: 1.2em;
}
.status-msg.error { color: var(--red); font-weight: 600; }
.status-msg.success { color: #1a7a1a; font-weight: 600; }
