* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #f0f2f5;
  color: #1a1a2e;
  min-height: 100vh;
}

.container {
  max-width: 620px;
  margin: 0 auto;
  padding: 0 16px 40px;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 0 14px;
  border-bottom: 3px solid #c0392b;
  margin-bottom: 24px;
}

.logo-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-img {
  height: 36px;
  width: auto;
  display: block;
}

.logo-img[style*="display:none"] + .logo-css { display: flex; }

.logo-css {
  display: none;
  flex-direction: column;
  line-height: 1;
}

.logo-melting {
  font-size: 1.1rem;
  font-weight: 900;
  letter-spacing: 0.18em;
  color: #1a1a2e;
}

.logo-home {
  font-size: 0.55rem;
  font-weight: 400;
  letter-spacing: 0.45em;
  color: #1a1a2e;
  text-align: center;
}

.app-titulo {
  font-size: 0.75rem;
  color: #888;
  border-left: 1px solid #ddd;
  padding-left: 10px;
  margin-left: 2px;
  white-space: nowrap;
}

nav a {
  display: inline-block;
  margin-left: 14px;
  color: #c0392b;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
}

.hidden { display: none !important; }

/* Formulario */
.field { margin-bottom: 16px; }

label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #666;
  margin-bottom: 6px;
}

select,
input[type="date"],
input[type="time"],
input[type="text"] {
  width: 100%;
  padding: 13px 12px;
  border: 2px solid #ddd;
  border-radius: 8px;
  font-size: 1rem;
  background: #fff;
  color: #1a1a2e;
  -webkit-appearance: none;
  appearance: none;
}

select:focus, input:focus {
  outline: none;
  border-color: #c0392b;
}

.turnos {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.turno-btn {
  padding: 11px 6px;
  border: 2px solid #ddd;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 700;
  text-align: center;
  color: #1a1a2e;
  line-height: 1.5;
  transition: all 0.15s;
}

.turno-btn span {
  display: block;
  font-weight: 400;
  font-size: 0.72rem;
  color: #888;
}

.turno-btn.activo {
  border-color: #c0392b;
  background: #c0392b;
  color: #fff;
}

.turno-btn.activo span { color: rgba(255,255,255,0.8); }

.horas-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.btn-primary {
  width: 100%;
  padding: 15px;
  background: #c0392b;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  margin-top: 6px;
  transition: background 0.15s;
}

.btn-primary:hover { background: #a93226; }

.mensaje {
  margin-top: 14px;
  padding: 12px 16px;
  border-radius: 8px;
  font-weight: 600;
  text-align: center;
  font-size: 0.95rem;
}

.mensaje.ok { background: #d4edda; color: #155724; }
.mensaje.error { background: #f8d7da; color: #721c24; }

/* Cards de registros */
.registros-hoy { margin-top: 30px; }
.registros-hoy h2 { font-size: 1rem; font-weight: 700; margin-bottom: 12px; }

.registro-card {
  background: #fff;
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 8px;
  border-left: 4px solid #c0392b;
  display: flex;
  align-items: center;
  gap: 8px;
}

.registro-info { flex: 1; }
.registro-nombre { font-weight: 700; font-size: 0.95rem; }
.registro-detalle { font-size: 0.8rem; color: #666; margin-top: 2px; }
.registro-horas { font-size: 1.05rem; font-weight: 700; color: #c0392b; white-space: nowrap; }

.btn-eliminar {
  background: none;
  border: none;
  color: #ccc;
  cursor: pointer;
  font-size: 1.3rem;
  line-height: 1;
  padding: 2px 6px;
  border-radius: 4px;
}

.btn-eliminar:hover { color: #c0392b; background: #fde8e6; }

/* Reportes tabs */
.tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  background: #ddd;
  padding: 4px;
  border-radius: 8px;
}

.tab-btn {
  flex: 1;
  padding: 9px 4px;
  border: none;
  border-radius: 6px;
  background: transparent;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  color: #666;
  transition: all 0.15s;
}

.tab-btn.activo {
  background: #fff;
  color: #c0392b;
  box-shadow: 0 1px 4px rgba(0,0,0,0.12);
}

.filtros {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
  align-items: flex-end;
}

.filtros select,
.filtros input[type="date"] { flex: 1; min-width: 120px; }

.btn-filtrar {
  padding: 13px 18px;
  background: #2c3e50;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
  font-size: 0.9rem;
  white-space: nowrap;
}

.btn-filtrar:hover { background: #1a252f; }

.btn-exportar {
  padding: 13px 14px;
  background: #27ae60;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
  font-size: 0.9rem;
  white-space: nowrap;
}

.btn-exportar:hover { background: #1e8449; }

/* Tablas */
.tabla-wrap { overflow-x: auto; border-radius: 8px; }

table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  font-size: 0.88rem;
  min-width: 480px;
}

thead th {
  background: #2c3e50;
  color: #fff;
  padding: 10px 12px;
  text-align: left;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

tbody td {
  padding: 9px 12px;
  border-bottom: 1px solid #f0f0f0;
  color: #1a1a2e;
}

tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: #fafafa; }

.td-horas { font-weight: 700; color: #c0392b; }

.total-row td {
  font-weight: 700;
  background: #f8f8f8;
  border-top: 2px solid #ddd;
}

/* Resumen */
.resumen-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.resumen-card {
  background: #fff;
  border-radius: 8px;
  padding: 16px;
}

.resumen-card h3 {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #666;
  margin-bottom: 12px;
  letter-spacing: 0.05em;
}

.resumen-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid #f0f0f0;
  font-size: 0.9rem;
}

.resumen-item:last-child { border-bottom: none; }
.resumen-horas { font-weight: 700; color: #c0392b; }

/* Admin */
.admin-section {
  background: #fff;
  border-radius: 8px;
  padding: 18px;
  margin-bottom: 16px;
}

.admin-section h2 { font-size: 1rem; font-weight: 700; margin-bottom: 14px; }

.admin-form {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.admin-form input { flex: 1; }

.btn-agregar {
  padding: 12px 18px;
  background: #2c3e50;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.btn-agregar:hover { background: #1a252f; }

.admin-lista { list-style: none; }

.admin-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid #f0f0f0;
  font-size: 0.95rem;
}

.admin-item:last-child { border-bottom: none; }

.btn-toggle {
  padding: 5px 12px;
  border: none;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
}

.btn-toggle.activo { background: #d4edda; color: #155724; }
.btn-toggle.inactivo { background: #f8d7da; color: #721c24; }

.sin-datos { color: #888; font-size: 0.9rem; padding: 16px 0; text-align: center; }

@media (max-width: 420px) {
  .resumen-grid { grid-template-columns: 1fr; }
  .turnos { grid-template-columns: 1fr; }
}
